Skip to content

Commit 2b71bf2

Browse files
GiteaBotlutingltlunny
authored
Display source code downloads last for release attachments (go-gitea#35897) (go-gitea#35903)
Backport go-gitea#35897 by lutinglt Typically, you want to download the binaries, not the source code. Co-authored-by: 鲁汀 <131967983+lutinglt@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 1ca4fef commit 2b71bf2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

templates/repo/release/list.tmpl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@
7878
{{ctx.Locale.Tr "repo.release.downloads"}}
7979
</summary>
8080
<ul class="ui divided list attachment-list">
81-
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
82-
<li class="item">
83-
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
84-
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
85-
</a>
86-
</li>
87-
<li class="item">
88-
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
89-
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
90-
</a>
91-
</li>
92-
{{end}}
9381
{{range $att := $release.Attachments}}
9482
<li class="item">
9583
<a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
@@ -105,6 +93,18 @@
10593
</div>
10694
</li>
10795
{{end}}
96+
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
97+
<li class="item">
98+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
99+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
100+
</a>
101+
</li>
102+
<li class="item">
103+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
104+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
105+
</a>
106+
</li>
107+
{{end}}
108108
</ul>
109109
</details>
110110
</div>

0 commit comments

Comments
 (0)