summaryrefslogtreecommitdiffstats
path: root/templates/repo/release/list.tmpl
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-08-01 00:57:02 +0800
committerGitHub <noreply@github.com>2022-07-31 18:57:02 +0200
commit589677fafb4b77112b7220a1c6089cec71d6db94 (patch)
tree1580defd542b1fe02e1a2f07e5487e6dea47ada6 /templates/repo/release/list.tmpl
parent2c2f75cb2cf0de6fdeeb931377873dd07ffbe774 (diff)
downloadgitea-589677fafb4b77112b7220a1c6089cec71d6db94.tar.gz
gitea-589677fafb4b77112b7220a1c6089cec71d6db94.zip
Add disable download source configuration (#20548)
Add configuration to enable/disable download source from UI. Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo/release/list.tmpl')
-rw-r--r--templates/repo/release/list.tmpl14
1 files changed, 9 insertions, 5 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index 58869d470c..4eb099129a 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -37,8 +37,10 @@
<div class="download df ac">
{{if $.Permission.CanRead $.UnitTypeCode}}
<a class="mr-3 mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
- <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a>
- <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}TAR.GZ</a>
+ {{if not $.DisableDownloadSourceArchives}}
+ <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a>
+ <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}TAR.GZ</a>
+ {{end}}
{{if (and $.CanCreateRelease $release.IsTag)}}
<a class="mr-3" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "mr-2"}}{{$.locale.Tr "repo.release.new_release"}}</a>
{{end}}
@@ -104,8 +106,10 @@
<div class="download">
{{if $.Permission.CanRead $.UnitTypeCode}}
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
- <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
- <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
+ {{if not $.DisableDownloadSourceArchives}}
+ <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
+ <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
+ {{end}}
{{end}}
</div>
{{else}}
@@ -146,7 +150,7 @@
{{$.locale.Tr "repo.release.downloads"}}
</summary>
<ul class="list">
- {{if and (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
+ {{if and (not $.DisableDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
<li>
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
</li>