Skip to content

Commit 9fbb898

Browse files
6543lunny
authored andcommitted
Show protection symbol if needed on default branch (#7660) (#7668)
* backport issue showing portection symbol if needet at default branch * sugestion to use range .Branches https://github.com/go-gitea/gitea/pull/7668/files/d57973a8041a741fdb7e77bc6ab18431bbf95ba4
1 parent 0a9794a commit 9fbb898

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

templates/repo/branch/list.tmpl

+8-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
<tbody>
1414
<tr>
1515
<td>
16-
{{if .IsProtected}}
17-
<i class="octicon octicon-shield"></i>
16+
{{range .Branches}}
17+
{{if eq .Name $.DefaultBranch}}
18+
{{if .IsProtected}}
19+
<i class="octicon octicon-shield"></i>
20+
{{end}}
21+
{{.Name}}
22+
{{end}}
1823
{{end}}
19-
{{.DefaultBranch}}
2024
</td>
2125
</tr>
2226
</tbody>
@@ -40,7 +44,7 @@
4044
</tr>
4145
</thead>
4246
<tbody>
43-
{{range $branch := .Branches}}
47+
{{range .Branches}}
4448
{{if ne .Name $.DefaultBranch}}
4549
<tr>
4650
<td>

0 commit comments

Comments
 (0)