Skip to content

Commit 4832cb9

Browse files
authored
Display when a release attachment was uploaded (#34261)
Fix #34260
1 parent 1b1d53a commit 4832cb9

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

templates/repo/release/list.tmpl

+18-12
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,31 @@
7373
<summary>
7474
{{ctx.Locale.Tr "repo.release.downloads"}}
7575
</summary>
76-
<ul class="list">
76+
<ul class="ui divided list attachment-list">
7777
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
78-
<li>
79-
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
78+
<li class="item">
79+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
80+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
81+
</a>
8082
</li>
81-
<li>
82-
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
83+
<li class="item">
84+
<a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
85+
<strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
86+
</a>
8387
</li>
8488
{{end}}
85-
{{range $release.Attachments}}
86-
<li>
87-
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
88-
<strong>{{svg "octicon-package" 16 "download-icon"}}{{.Name}}</strong>
89+
{{range $att := $release.Attachments}}
90+
<li class="item">
91+
<a target="_blank" class="tw-flex-grow-[2] gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
92+
<strong class="flex-text-inline">{{svg "octicon-package" 16 "download-icon"}}<span class="gt-ellipsis">{{$att.Name}}</span></strong>
8993
</a>
90-
<div>
91-
<span class="text grey">{{.Size | FileSize}}</span>
92-
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
94+
<div class="attachment-right-info flex-text-inline">
95+
<span class="tw-pl-5">{{$att.Size | FileSize}}</span>
96+
<span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber $att.DownloadCount)}}">
9397
{{svg "octicon-info"}}
9498
</span>
99+
<div class="tw-flex-1"></div>
100+
{{DateUtils.TimeSince $att.CreatedUnix}}
95101
</div>
96102
</li>
97103
{{end}}

web_src/css/repo/release-tag.css

+9-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#release-list .release-entry .detail {
3232
flex: 1;
3333
margin: 0;
34+
min-width: 0;
3435
}
3536

3637
@media (max-width: 767.98px) {
@@ -58,25 +59,27 @@
5859
margin-bottom: 2px; /* the legacy trick to align the avatar vertically, no better solution at the moment */
5960
}
6061

61-
#release-list .release-entry .detail .download .list {
62-
padding-left: 0;
62+
#release-list .release-entry .attachment-list {
6363
border: 1px solid var(--color-secondary);
6464
border-radius: var(--border-radius);
6565
}
6666

67-
#release-list .release-entry .detail .download .list li {
67+
#release-list .release-entry .attachment-list > .item {
6868
display: flex;
69-
justify-content: space-between;
7069
padding: 8px;
71-
border-bottom: 1px solid var(--color-secondary);
70+
flex-wrap: wrap;
71+
}
72+
73+
#release-list .release-entry .attachment-list .attachment-right-info {
74+
flex-grow: 1;
75+
min-width: 300px;
7276
}
7377

7478
#release-list .release-entry .detail .download[open] summary {
7579
margin-bottom: 10px;
7680
}
7781

7882
#release-list .download-icon {
79-
margin-right: .25rem;
8083
color: var(--color-text-light-1);
8184
}
8285

0 commit comments

Comments
 (0)