Skip to content

Commit 3a9fcac

Browse files
Update protected_branch.tmpl (#34193)
Show correct message for new/edit. Add "required" to rule name. --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 58a3952 commit 3a9fcac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

templates/repo/settings/protected_branch.tmpl

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
<div class="repo-setting-content">
33
<form class="ui form" action="{{.Link}}" method="post">
44
<h4 class="ui top attached header">
5-
{{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
5+
{{if .Rule.RuleName}}
6+
{{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
7+
{{else}}
8+
{{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}}
9+
{{end}}
610
</h4>
711
<div class="ui attached segment branch-protection">
812
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>
9-
<div class="field">
13+
<div class="field required">
1014
<label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
11-
<input name="rule_name" type="text" value="{{.Rule.RuleName}}">
15+
<input name="rule_name" type="text" value="{{.Rule.RuleName}}" required>
1216
<input name="rule_id" type="hidden" value="{{.Rule.ID}}">
1317
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern_desc" "https://github.com/gobwas/glob"}}</p>
1418
</div>

0 commit comments

Comments
 (0)