Skip to content

Commit 3db060c

Browse files
committed
optimize if statement for protected branches
1 parent f39a9a3 commit 3db060c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/repo/branch/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@
9999
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
100100
</div>
101101
</div>
102-
{{if and $.IsWriter (not $.IsMirror)}}
103-
{{if and .IsDeleted (not .IsProtected)}}
102+
{{if and $.IsWriter (not $.IsMirror) (not .IsProtected)}}
103+
{{if .IsDeleted}}
104104
<a class="ui basic jump button icon poping up undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.restore" (.Name | EscapePound)}}" data-variation="tiny inverted" data-position="top right"><i class="octicon octicon-reply text blue"></i></a>
105-
{{else if (not .IsProtected)}}
105+
{{else}}
106106
<a class="ui basic jump button icon poping up delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.delete" (.Name | EscapePound)}}" data-variation="tiny inverted" data-position="top right" data-name="{{.Name}}"><i class="trash icon text red"></i></a>
107107
{{end}}
108108
{{end}}

0 commit comments

Comments
 (0)