Skip to content

Commit b4ed3f0

Browse files
Fix commit name in Apply Patch page (#23086) (#23099)
Backport #23086 Fixes #22621 (comment) Co-authored-by: yp05327 <[email protected]>
1 parent ced94f2 commit b4ed3f0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

routers/web/repo/patch.go

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const (
2525
func NewDiffPatch(ctx *context.Context) {
2626
canCommit := renderCommitRights(ctx)
2727

28+
ctx.Data["PageIsPatch"] = true
29+
2830
ctx.Data["TreePath"] = ""
2931

3032
ctx.Data["commit_summary"] = ""
@@ -51,6 +53,7 @@ func NewDiffPatchPost(ctx *context.Context) {
5153
if form.CommitChoice == frmCommitChoiceNewBranch {
5254
branchName = form.NewBranchName
5355
}
56+
ctx.Data["PageIsPatch"] = true
5457
ctx.Data["TreePath"] = ""
5558
ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
5659
ctx.Data["FileContent"] = form.Content

templates/repo/editor/commit_form.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{.locale.Tr "repo.editor.commit_changes"}}
1010
{{- end}}</h3>
1111
<div class="field">
12-
<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
12+
<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
1313
</div>
1414
<div class="field">
1515
<textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>

0 commit comments

Comments
 (0)