Skip to content

Commit 1b899c8

Browse files
committed
fix source download link when no code unit allowed (go-gitea#3166)
1 parent d63ca66 commit 1b899c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

templates/repo/release/list.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
<a href="{{$.RepoLink}}/src/tag/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a>
4242
</h4>
4343
<div class="download">
44+
{{if $.Repository.UnitEnabled $.UnitTypeCode}}
4445
<a href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a>
4546
<a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> ZIP</a>
4647
<a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
48+
{{end}}
4749
</div>
4850
{{else}}
4951
<h3>
@@ -64,12 +66,14 @@
6466
<div class="download">
6567
<h2>{{$.i18n.Tr "repo.release.downloads"}}</h2>
6668
<ul class="list">
69+
{{if $.Repository.UnitEnabled $.UnitTypeCode}}
6770
<li>
6871
<a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</a>
6972
</li>
7073
<li>
7174
<a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</a>
7275
</li>
76+
{{end}}
7377
{{if .Attachments}}
7478
{{range .Attachments}}
7579
<li>

0 commit comments

Comments
 (0)