Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken cancel button link on patch page #18718

Merged
merged 6 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routers/web/repo/cherry_pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions routers/web/repo/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = ""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/editor/patch.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="divider">:</div>
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
<span>{{.i18n.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.i18n.Tr "repo.editor.cancel_lower"}}</a></span>
<input type="hidden" id="tree_path" name="tree_path" value="patch" required>
<input type="hidden" id="tree_path" name="tree_path" value="" required>
<input id="file-name" type="hidden" value="diff.patch">
</div>
</div>
Expand Down