Skip to content

Commit 684b27a

Browse files
committed
dont downloat a deleted branch - fix error 404
1 parent 3db060c commit 684b27a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

templates/repo/branch/list.tmpl

+8-6
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@
9292
{{end}}
9393
</td>
9494
<td class="two wide right aligned overflow-visible">
95-
<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name|EscapePound)}}" data-variation="tiny inverted" data-position="top right">
96-
<i class="download icon"></i>
97-
<div class="menu">
98-
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
99-
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
95+
{{if (not .IsDeleted)}}
96+
<div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name|EscapePound)}}" data-variation="tiny inverted" data-position="top right">
97+
<i class="download icon"></i>
98+
<div class="menu">
99+
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
100+
<a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
101+
</div>
100102
</div>
101-
</div>
103+
{{end}}
102104
{{if and $.IsWriter (not $.IsMirror) (not .IsProtected)}}
103105
{{if .IsDeleted}}
104106
<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>

0 commit comments

Comments
 (0)