|
37 | 37 | <div class="download df ac">
|
38 | 38 | {{if $.Permission.CanRead $.UnitTypeCode}}
|
39 | 39 | <a class="mr-3 mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
|
40 |
| - <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a> |
41 |
| - <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> |
| 40 | + {{if not $.DisableDownloadSourceArchives}} |
| 41 | + <a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a> |
| 42 | + <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> |
| 43 | + {{end}} |
42 | 44 | {{if (and $.CanCreateRelease $release.IsTag)}}
|
43 | 45 | <a class="mr-3" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "mr-2"}}{{$.i18n.Tr "repo.release.new_release"}}</a>
|
44 | 46 | {{end}}
|
|
104 | 106 | <div class="download">
|
105 | 107 | {{if $.Permission.CanRead $.UnitTypeCode}}
|
106 | 108 | <a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
|
107 |
| - <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> |
108 |
| - <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a> |
| 109 | + {{if not $.DisableDownloadSourceArchives}} |
| 110 | + <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> |
| 111 | + <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a> |
| 112 | + {{end}} |
109 | 113 | {{end}}
|
110 | 114 | </div>
|
111 | 115 | {{else}}
|
|
146 | 150 | {{$.i18n.Tr "repo.release.downloads"}}
|
147 | 151 | </summary>
|
148 | 152 | <ul class="list">
|
149 |
| - {{if and (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} |
| 153 | + {{if and (not $.DisableDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} |
150 | 154 | <li>
|
151 | 155 | <a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "mr-2"}}{{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a>
|
152 | 156 | </li>
|
|
0 commit comments