From 2225bd3795c780fccd0ed6bec0624587e8b6ad61 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Sat, 29 Aug 2020 19:10:17 +0100 Subject: [PATCH] Do not disable commit changes button on repost If the user has pressed commit changes and the post has failed - do not disable the commit changes button. Fix #12072 Signed-off-by: Andrew Thornton --- routers/repo/editor.go | 1 + templates/repo/editor/edit.tmpl | 1 + web_src/js/index.js | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/routers/repo/editor.go b/routers/repo/editor.go index f91ce1b462f43..6a3f379f6a01f 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -184,6 +184,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo } ctx.Data["PageIsEdit"] = true + ctx.Data["PageHasPosted"] = true ctx.Data["IsNewFile"] = isNewFile ctx.Data["RequireHighlightJS"] = true ctx.Data["RequireSimpleMDE"] = true diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index af65813b33af4..db012728e73bc 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -6,6 +6,7 @@
{{.CsrfTokenHtml}} +