Skip to content

Commit 66be63a

Browse files
committed
move protected icon to first colum
backport parts of go-gitea#7461
1 parent 976444f commit 66be63a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

templates/repo/branch/list.tmpl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
<table class="ui very basic striped fixed table single line">
1313
<tbody>
1414
<tr>
15-
<td>{{.DefaultBranch}}</td>
15+
<td>
16+
{{if .IsProtected}}
17+
<i class="octicon octicon-shield"></i>
18+
{{end}}
19+
{{.DefaultBranch}}
20+
</td>
1621
</tr>
1722
</tbody>
1823
</table>
@@ -43,6 +48,9 @@
4348
<s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
4449
<p class="time">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
4550
{{else}}
51+
{{if .IsProtected}}
52+
<i class="octicon octicon-shield"></i>
53+
{{end}}
4654
<a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a>
4755
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
4856
{{end}}
@@ -81,11 +89,9 @@
8189
</td>
8290
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}}
8391
<td class="right aligned">
84-
{{if .IsProtected}}
85-
<i class="octicon octicon-shield"></i>
86-
{{else if .IsDeleted}}
92+
{{if and .IsDeleted (not .IsProtected)}}
8793
<a class="undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}"><i class="octicon octicon-reply"></i></a>
88-
{{else}}
94+
{{else if (not .IsProtected)}}
8995
<a class="delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-name="{{.Name}}"><i class="trash icon text red"></i></a>
9096
{{end}}
9197
</td>

0 commit comments

Comments
 (0)