Skip to content

Commit 08fe6f8

Browse files
lunnyzeripath
andauthored
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 <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
1 parent 581a563 commit 08fe6f8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

routers/web/repo/cherry_pick.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func CherryPick(ctx *context.Context) {
5050
ctx.Data["RequireHighlightJS"] = true
5151

5252
canCommit := renderCommitRights(ctx)
53-
ctx.Data["TreePath"] = "patch"
53+
ctx.Data["TreePath"] = ""
5454

5555
if canCommit {
5656
ctx.Data["commit_choice"] = frmCommitChoiceDirect

routers/web/repo/patch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func NewDiffPatch(ctx *context.Context) {
2828

2929
canCommit := renderCommitRights(ctx)
3030

31-
ctx.Data["TreePath"] = "patch"
31+
ctx.Data["TreePath"] = ""
3232

3333
ctx.Data["commit_summary"] = ""
3434
ctx.Data["commit_message"] = ""
@@ -55,7 +55,7 @@ func NewDiffPatchPost(ctx *context.Context) {
5555
branchName = form.NewBranchName
5656
}
5757
ctx.Data["RequireHighlightJS"] = true
58-
ctx.Data["TreePath"] = "patch"
58+
ctx.Data["TreePath"] = ""
5959
ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
6060
ctx.Data["FileContent"] = form.Content
6161
ctx.Data["commit_summary"] = form.CommitSummary

templates/repo/editor/patch.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="divider">:</div>
1616
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
1717
<span>{{.i18n.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.i18n.Tr "repo.editor.cancel_lower"}}</a></span>
18-
<input type="hidden" id="tree_path" name="tree_path" value="patch" required>
18+
<input type="hidden" id="tree_path" name="tree_path" value="" required>
1919
<input id="file-name" type="hidden" value="diff.patch">
2020
</div>
2121
</div>

0 commit comments

Comments
 (0)