feat: show timestamp on release attachments (#8757)

- Show the `created_unix` timestamp as relative time for each non-external release attachment.
- The details section of the release attachment can become quite long in width, for smaller screens it's now shown as columns.
- Integration test added.

Close #7600

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8757
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Squel <squeljur+git@gmail.com>
Co-committed-by: Squel <squeljur+git@gmail.com>
This commit is contained in:
Squel 2025-08-08 03:19:28 +02:00 committed by Gusted
commit dd653c4784
2 changed files with 21 additions and 2 deletions

View file

@ -103,12 +103,12 @@
</a>
</li>
{{else}}
<li>
<li class="max-sm:tw-flex-col max-sm:tw-gap-2">
<a class="tw-flex-1 flex-text-inline tw-font-bold" target="_blank" rel="nofollow" href="{{.DownloadURL}}" download>
{{svg "octicon-package" 16 "tw-mr-1"}}{{.Name}}
</a>
<div>
<span class="text grey">{{ctx.Locale.TrN .DownloadCount "repo.release.download_count_one" "repo.release.download_count_few" (ctx.Locale.PrettyNumber .DownloadCount)}} · {{.Size | ctx.Locale.TrSize}}</span>
<span class="text grey">{{ctx.Locale.TrN .DownloadCount "repo.release.download_count_one" "repo.release.download_count_few" (ctx.Locale.PrettyNumber .DownloadCount)}} · {{DateUtils.TimeSince .CreatedUnix}} · {{.Size | ctx.Locale.TrSize}}</span>
</div>
</li>
{{end}}