diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-12-12 15:54:39 +0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-12-12 15:54:39 +0800 |
commit | aee45d072ecd241f4eee80a24bba9e86a0b85a4a (patch) | |
tree | 89a9a0d8079fc691204f08a3f03b72f6aa1ff1de | |
parent | e893aced89ed78eec98d1da5686f8cc8216925a8 (diff) | |
download | gitea-aee45d072ecd241f4eee80a24bba9e86a0b85a4a.tar.gz gitea-aee45d072ecd241f4eee80a24bba9e86a0b85a4a.zip |
Fix source download link when no code unit allowed (#3166) (#3169)
-rw-r--r-- | templates/repo/release/list.tmpl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 2fed9ae588..d5254044ce 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> |