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
This commit is contained in:
6543
2019-07-30 22:48:53 +08:00
committed by Lunny Xiao
parent 0a9794a6bc
commit 9fbb898058
+6 -2
View File
@@ -13,10 +13,14 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
{{range .Branches}}
{{if eq .Name $.DefaultBranch}}
{{if .IsProtected}} {{if .IsProtected}}
<i class="octicon octicon-shield"></i> <i class="octicon octicon-shield"></i>
{{end}} {{end}}
{{.DefaultBranch}} {{.Name}}
{{end}}
{{end}}
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -40,7 +44,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{range $branch := .Branches}} {{range .Branches}}
{{if ne .Name $.DefaultBranch}} {{if ne .Name $.DefaultBranch}}
<tr> <tr>
<td> <td>