Skip to content

Commit fbaebbd

Browse files
author
Earl Warren
committed
Merge pull request '[v7.0/forgejo] [FEAT] Visual separation between types of attachments' (go-gitea#3029) from bp-v7.0/forgejo-20a3597 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3029 Reviewed-by: 0ko <[email protected]>
2 parents 139979f + 86d018d commit fbaebbd

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2635,11 +2635,12 @@ release.tag_name_invalid = The tag name is not valid.
26352635
release.tag_name_protected = The tag name is protected.
26362636
release.tag_already_exist = This tag name already exists.
26372637
release.downloads = Downloads
2638-
release.download_count = Downloads: %s
2638+
release.download_count = %s downloads
26392639
release.add_tag_msg = Use the title and content of release as tag message.
26402640
release.add_tag = Create Tag Only
26412641
release.releases_for = Releases for %s
26422642
release.tags_for = Tags for %s
2643+
release.system_generated = This attachment is automatically generated.
26432644

26442645
branch.name = Branch name
26452646
branch.already_exists = A branch named "%s" already exists.

templates/repo/release/list.tmpl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,29 @@
6767
{{ctx.Locale.Tr "repo.release.downloads"}}
6868
</summary>
6969
<ul class="list">
70+
{{$hasReleaseAttachment := gt (len $release.Attachments) 0}}
7071
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
7172
<li>
7273
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
74+
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.system_generated"}}">
75+
{{svg "octicon-info"}}
76+
</span>
7377
</li>
74-
<li>
78+
<li class="{{if $hasReleaseAttachment}}start-gap{{end}}">
7579
<a class="archive-link" href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
80+
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.system_generated"}}">
81+
{{svg "octicon-info"}}
82+
</span>
7683
</li>
84+
{{if $hasReleaseAttachment}}<hr>{{end}}
7785
{{end}}
7886
{{range $release.Attachments}}
7987
<li>
8088
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
8189
<strong>{{svg "octicon-package" 16 "tw-mr-1"}}{{.Name}}</strong>
8290
</a>
8391
<div>
84-
<span class="text grey">{{.Size | ctx.Locale.TrSize}}</span>
85-
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
86-
{{svg "octicon-info"}}
87-
</span>
92+
<span class="text grey">{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}} · {{.Size | ctx.Locale.TrSize}}</span>
8893
</div>
8994
</li>
9095
{{end}}

templates/repo/release/new.tmpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@
6464
<div class="flex-text-inline tw-flex-1">
6565
<input name="attachment-edit-{{.UUID}}" class="attachment_edit" required value="{{.Name}}">
6666
<input name="attachment-del-{{.UUID}}" type="hidden" value="false">
67-
<span class="ui text grey tw-whitespace-nowrap">{{.Size | ctx.Locale.TrSize}}</span>
68-
<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
69-
{{svg "octicon-info"}}
70-
</span>
67+
<span class="ui text grey tw-whitespace-nowrap">{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}} · {{.Size | ctx.Locale.TrSize}}</span>
7168
</div>
7269
<a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}">
7370
{{ctx.Locale.Tr "remove"}}

web_src/css/repo/release-tag.css

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,32 @@
3333

3434
.repository.releases #release-list > li .detail .download .list {
3535
padding-left: 0;
36-
border: 1px solid var(--color-secondary);
37-
border-radius: var(--border-radius);
38-
background: var(--color-light);
3936
}
4037

4138
.repository.releases #release-list > li .detail .download .list li {
39+
background: var(--color-light);
40+
border: 1px solid var(--color-secondary);
41+
border-top: none;
4242
display: flex;
4343
justify-content: space-between;
4444
padding: 8px;
45+
}
46+
47+
.repository.releases #release-list > li .detail .download .list :is(li:first-child, .start-gap + hr + li) {
48+
border-top: 1px solid var(--color-secondary);
49+
border-top-left-radius: var(--border-radius);
50+
border-top-right-radius: var(--border-radius);
51+
}
52+
53+
.repository.releases #release-list > li .detail .download .list :is(li:last-child, .start-gap) {
4554
border-bottom: 1px solid var(--color-secondary);
55+
border-bottom-left-radius: var(--border-radius);
56+
border-bottom-right-radius: var(--border-radius);
4657
}
4758

48-
.repository.releases #release-list > li .detail .download .list li:last-child {
49-
border-bottom: none;
59+
.repository.releases #release-list > li .detail .download .list hr {
60+
height: 8px;
61+
margin: 0;
5062
}
5163

5264
.repository.releases #release-list > li .detail .dot {

0 commit comments

Comments
 (0)