aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-12-12 14:45:02 +0800
committerLauris BH <lauris@nix.lv>2017-12-12 08:45:02 +0200
commite3f88719ab40dacca3f37ac3589f2db6223946f6 (patch)
tree98065c1706d65beb2cadbb4970a2dd46fcfdab5a /templates
parentf27a6461e3247bdc1eae3be04b7718bc9b97419b (diff)
downloadgitea-e3f88719ab40dacca3f37ac3589f2db6223946f6.tar.gz
gitea-e3f88719ab40dacca3f37ac3589f2db6223946f6.zip
fix source download link when no code unit allowed (#3166)
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/release/list.tmpl4
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 0a3af5a844..dd220b6a84 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -41,9 +41,11 @@
<a href="{{$.RepoLink}}/src/tag/{{.TagName}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a>
</h4>
<div class="download">
+ {{if $.Repository.UnitEnabled $.UnitTypeCode}}
<a href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a>
<a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> ZIP</a>
<a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
+ {{end}}
</div>
{{else}}
<h3>
@@ -64,12 +66,14 @@
<div class="download">
<h2>{{$.i18n.Tr "repo.release.downloads"}}</h2>
<ul class="list">
+ {{if $.Repository.UnitEnabled $.UnitTypeCode}}
<li>
<a href="{{$.RepoLink}}/archive/{{.TagName}}.zip" rel="nofollow"><i class="octicon octicon-file-zip"></i> {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</a>
</li>
<li>
<a href="{{$.RepoLink}}/archive/{{.TagName}}.tar.gz"><i class="octicon octicon-file-zip"></i> {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</a>
</li>
+ {{end}}
{{if .Attachments}}
{{range .Attachments}}
<li>