From 08fe6f8c7ee4b446ae489843414d237cf3e458b5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 14 Feb 2022 17:18:55 +0800 Subject: [PATCH] Fix broken cancel button link on patch page (#18718) * Fix broken cacnel button link on patch page * remove treepath="patch" elsewhere too Signed-off-by: Andrew Thornton Co-authored-by: zeripath --- routers/web/repo/cherry_pick.go | 2 +- routers/web/repo/patch.go | 4 ++-- templates/repo/editor/patch.tmpl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/web/repo/cherry_pick.go b/routers/web/repo/cherry_pick.go index 1b0d8452e2ba..eb228093480d 100644 --- a/routers/web/repo/cherry_pick.go +++ b/routers/web/repo/cherry_pick.go @@ -50,7 +50,7 @@ func CherryPick(ctx *context.Context) { ctx.Data["RequireHighlightJS"] = true canCommit := renderCommitRights(ctx) - ctx.Data["TreePath"] = "patch" + ctx.Data["TreePath"] = "" if canCommit { ctx.Data["commit_choice"] = frmCommitChoiceDirect diff --git a/routers/web/repo/patch.go b/routers/web/repo/patch.go index b00065a6ee9d..e08cde89f2e5 100644 --- a/routers/web/repo/patch.go +++ b/routers/web/repo/patch.go @@ -28,7 +28,7 @@ func NewDiffPatch(ctx *context.Context) { canCommit := renderCommitRights(ctx) - ctx.Data["TreePath"] = "patch" + ctx.Data["TreePath"] = "" ctx.Data["commit_summary"] = "" ctx.Data["commit_message"] = "" @@ -55,7 +55,7 @@ func NewDiffPatchPost(ctx *context.Context) { branchName = form.NewBranchName } ctx.Data["RequireHighlightJS"] = true - ctx.Data["TreePath"] = "patch" + ctx.Data["TreePath"] = "" ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL() ctx.Data["FileContent"] = form.Content ctx.Data["commit_summary"] = form.CommitSummary diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl index cecda907a43d..c108d0915953 100644 --- a/templates/repo/editor/patch.tmpl +++ b/templates/repo/editor/patch.tmpl @@ -15,7 +15,7 @@
:
{{.BranchName}} {{.i18n.Tr "repo.editor.or"}} {{.i18n.Tr "repo.editor.cancel_lower"}} - +