fix: release page improvements and dark mode dropzone
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m43s
Build and Release / Unit Tests (push) Successful in 2m3s
Build and Release / Lint (push) Failing after 2m3s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped

- Latest release downloads always expanded (no collapsible)
- Show archived checkbox moved to right of Release/Tag toggle
- 8px top padding for OS group sections
- Improved OS detection patterns for zip files
- Fixed dark mode dropzone styling
- Renamed slice to newSlice to avoid conflict with Go builtin

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
David H Friedel Jr 2026-01-11 04:43:36 +00:00
parent 6795122e00
commit 3a1075d6a0
4 changed files with 52 additions and 23 deletions

View File

@ -48,7 +48,7 @@ func NewFuncMap() template.FuncMap {
// utils
"StringUtils": NewStringUtils,
"SliceUtils": NewSliceUtils,
"slice": func() []any { return []any{} },
"newSlice": func() []any { return []any{} },
"Append": func(s []any, v any) []any { return append(s, v) },
"JsonUtils": NewJsonUtils,
"DateUtils": NewDateUtils,

View File

@ -88,24 +88,30 @@
{{$release.RenderedNote}}
</div>
<div class="divider"></div>
<details class="download" {{if eq $idx 0}}open{{end}}>
{{/* For the first/latest release, show downloads directly without collapsible */}}
{{if eq $idx 0}}
<div class="download-section">
{{else}}
<details class="download">
<summary>
{{ctx.Locale.Tr "repo.release.downloads"}}
</summary>
{{end}}
{{/* Group attachments by OS */}}
{{$windowsFiles := slice}}
{{$macosFiles := slice}}
{{$linuxFiles := slice}}
{{$otherFiles := slice}}
{{$windowsFiles := newSlice}}
{{$macosFiles := newSlice}}
{{$linuxFiles := newSlice}}
{{$otherFiles := newSlice}}
{{range $att := $release.Attachments}}
{{$name := StringUtils.ToLower $att.Name}}
{{if or (StringUtils.Contains $name "windows") (StringUtils.Contains $name "win64") (StringUtils.Contains $name "win32") (StringUtils.Contains $name ".exe") (StringUtils.Contains $name ".msi")}}
{{if or (StringUtils.Contains $name "windows") (StringUtils.Contains $name "win64") (StringUtils.Contains $name "win32") (StringUtils.Contains $name "-win.") (StringUtils.Contains $name "_win.") (StringUtils.Contains $name "-win-") (StringUtils.Contains $name "_win_") (StringUtils.Contains $name ".exe") (StringUtils.Contains $name ".msi")}}
{{$windowsFiles = Append $windowsFiles $att}}
{{else if or (StringUtils.Contains $name "darwin") (StringUtils.Contains $name "macos") (StringUtils.Contains $name "osx") (StringUtils.Contains $name ".dmg") (StringUtils.Contains $name ".pkg")}}
{{else if or (StringUtils.Contains $name "darwin") (StringUtils.Contains $name "macos") (StringUtils.Contains $name "-mac.") (StringUtils.Contains $name "_mac.") (StringUtils.Contains $name "-mac-") (StringUtils.Contains $name "_mac_") (StringUtils.Contains $name "osx") (StringUtils.Contains $name ".dmg") (StringUtils.Contains $name ".pkg")}}
{{$macosFiles = Append $macosFiles $att}}
{{else if or (StringUtils.Contains $name "linux") (StringUtils.Contains $name ".deb") (StringUtils.Contains $name ".rpm") (StringUtils.Contains $name ".appimage")}}
{{else if or (StringUtils.Contains $name "linux") (StringUtils.Contains $name "-lin.") (StringUtils.Contains $name "_lin.") (StringUtils.Contains $name "-lin-") (StringUtils.Contains $name "_lin_") (StringUtils.Contains $name ".deb") (StringUtils.Contains $name ".rpm") (StringUtils.Contains $name ".appimage")}}
{{$linuxFiles = Append $linuxFiles $att}}
{{else}}
{{$otherFiles = Append $otherFiles $att}}
@ -114,7 +120,7 @@
{{/* Windows Downloads */}}
{{if $windowsFiles}}
<div class="tw-mb-3">
<div class="tw-pt-2 tw-mb-3">
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2 tw-font-medium">
{{svg "octicon-device-desktop" 16}} Windows
</h5>
@ -140,7 +146,7 @@
{{/* macOS Downloads */}}
{{if $macosFiles}}
<div class="tw-mb-3">
<div class="tw-pt-2 tw-mb-3">
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2 tw-font-medium">
{{svg "octicon-device-desktop" 16}} macOS
</h5>
@ -166,7 +172,7 @@
{{/* Linux Downloads */}}
{{if $linuxFiles}}
<div class="tw-mb-3">
<div class="tw-pt-2 tw-mb-3">
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2 tw-font-medium">
{{svg "octicon-terminal" 16}} Linux
</h5>
@ -192,7 +198,7 @@
{{/* Other Downloads */}}
{{if $otherFiles}}
<div class="tw-mb-3">
<div class="tw-pt-2 tw-mb-3">
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2 tw-font-medium">
{{svg "octicon-file" 16}} Other
</h5>
@ -218,7 +224,7 @@
{{/* Source Code Archives */}}
{{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
<div class="tw-mb-3">
<div class="tw-pt-2 tw-mb-3">
<h5 class="tw-flex tw-items-center tw-gap-2 tw-mb-2 tw-font-medium">
{{svg "octicon-code" 16}} Source Code
</h5>
@ -236,7 +242,12 @@
</ul>
</div>
{{end}}
{{if eq $idx 0}}
</div>
{{else}}
</details>
{{end}}
</div>
</li>
{{end}}

View File

@ -3,13 +3,19 @@
{{if $canReadReleases}}
<div class="flex-text-block">
<div class="tw-flex-1 tw-flex tw-items-center">
<div class="tw-flex-1 tw-flex tw-items-center tw-gap-4">
<h2 class="ui compact small menu small-menu-items">
<a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
{{if $canReadCode}}
<a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
{{end}}
</h2>
{{if and .PageIsReleaseList (not .PageIsSingleTag)}}
<div class="ui checkbox">
<input type="checkbox" id="show-archived" {{if .ShowArchived}}checked{{end}} onchange="window.location.href='{{.RepoLink}}/releases?archived=' + (this.checked ? 'true' : 'false')">
<label for="show-archived">{{ctx.Locale.Tr "repo.release.show_archived"}}</label>
</div>
{{end}}
</div>
{{if .EnableFeed}}
<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
@ -22,14 +28,6 @@
</a>
{{end}}
</div>
{{if and .PageIsReleaseList (not .PageIsSingleTag)}}
<div class="tw-flex tw-items-center tw-mb-2">
<div class="ui checkbox">
<input type="checkbox" id="show-archived" {{if .ShowArchived}}checked{{end}} onchange="window.location.href='{{.RepoLink}}/releases?archived=' + (this.checked ? 'true' : 'false')">
<label for="show-archived">{{ctx.Locale.Tr "repo.release.show_archived"}}</label>
</div>
</div>
{{end}}
<div class="divider"></div>
{{else if $canReadCode}}
{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}

View File

@ -57,3 +57,23 @@
then the layout from top to bottom is: size, filename, progress */
top: 7em;
}
/* Fix dark mode dropzone details */
.dropzone .dz-preview .dz-details {
background: var(--color-body) !important;
color: var(--color-text) !important;
}
.dropzone .dz-preview .dz-details .dz-size,
.dropzone .dz-preview .dz-details .dz-filename {
color: var(--color-text) !important;
}
.dropzone .dz-preview .dz-details .dz-filename span {
background: transparent !important;
}
.dropzone .dz-preview .dz-success-mark,
.dropzone .dz-preview .dz-error-mark {
background: var(--color-body) !important;
}