This commit is contained in:
Minecon724 2025-06-03 18:08:29 +02:00
commit 6d6ac6afe3
9 changed files with 17 additions and 15 deletions

View file

@ -26,8 +26,8 @@ type Theme struct {
Description string
// Scheme is the theme's color scheme. It must be either: dark, light, or auto.
Scheme string
// Verified is whether the theme is verified. It means the theme is guaranteed to be bug-free, which happens more with third-party themes.
Verified bool
// Recommended means the theme is guaranteed to be bug-free, usually a first-party theme.
Recommended bool
}
// loadThemeMeta loads theme metadata from a file in a layered FS.
@ -54,7 +54,7 @@ func loadThemeMeta(assetFs *assetfs.LayeredFS, filename string, theme *Theme) er
theme.Url = kv["url"]
theme.Description = kv["description"]
theme.Scheme = strings.ToLower(kv["scheme"])
theme.Verified = kv["verified"] == "yes"
theme.Recommended = kv["recommended"] == "yes"
return nil
}

View file

@ -148,7 +148,7 @@
"actions.runs.run_attempt_label": "Run attempt #%[1]s (%[2]s)",
"actions.runs.viewing_out_of_date_run": "You are viewing an out-of-date run of this job that was executed %[1]s.",
"actions.runs.view_most_recent_run": "View most recent run",
"settings.theme_verified": "Verified",
"settings.theme_recommended": "Recommended",
"settings.theme_light": "Light",
"settings.theme_dark": "Dark",
"settings.theme_auto": "Auto (per your browser)",

View file

@ -12,7 +12,7 @@
<div class="item">
<p>
<strong>{{$theme.Name}}</strong>
by <em><a href="{{$theme.Url}}">{{$theme.Author}}</a></em> {{if $theme.Verified}}<span data-tooltip-content="{{ctx.Locale.Tr "settings.theme_verified"}}">{{svg "octicon-verified" 16 "dropdown icon"}}</span>{{end}}
by <em><a href="{{$theme.Url}}">{{$theme.Author}}</a></em> {{if $theme.Recommended}}<span data-tooltip-content="{{ctx.Locale.Tr "settings.theme_recommended"}}">{{svg "octicon-star" 16 "dropdown icon"}}</span>{{end}}
</p>
{{if $theme.Description}}
<p><em>"{{$theme.Description}}"</em></p>
@ -37,16 +37,18 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="text">
{{- range $i,$a := .AllThemes -}}
{{if eq $.SignedUser.Theme $i}}{{$a.Name}}{{end}}
{{if eq $.SignedUser.Theme $i}}
{{$a.Name}}
{{end}}
{{- end -}}
</div>
<div class="menu">
{{range $i,$a := .AllThemes}}
<div class="item{{if eq $.SignedUser.Theme $i}} active selected{{end}} tw-flex" data-value="{{$i}}">
<div class="item{{if eq $.SignedUser.Theme $i}} active selected{{end}} tw-flex " data-value="{{$i}}">
{{$a.Name}}
{{if $a.Verified}}
<span data-tooltip-content="{{ctx.Locale.Tr "settings.theme_verified"}}">{{svg "octicon-verified" 16 "dropdown icon"}}</span>
{{if $a.Recommended}}
<span data-tooltip-content="{{ctx.Locale.Tr "settings.theme_recommended"}}">{{svg "octicon-star" 16 "dropdown icon"}}</span>
{{end}}
{{if eq $a.Scheme "auto"}}
<span data-tooltip-content="{{ctx.Locale.Tr "settings.theme_auto"}}">{{svg "octicon-sync" 16 "dropdown icon"}}</span>

View file

@ -5,7 +5,7 @@
Url https://forgejo.org/
Description The fresh of freedom.
Scheme Auto
Verified
Recommended
*/
@import "theme-forgejo-light.css";

View file

@ -5,7 +5,7 @@
Url https://forgejo.org/
Description The fresh of freedom.
Scheme Dark
Verified
Recommended
*/
@import "../chroma/dark.css";

View file

@ -5,7 +5,7 @@
Url https://forgejo.org/
Description The fresh of freedom.
Scheme Light
Verified
Recommended
*/
@import "../chroma/light.css";

View file

@ -5,7 +5,7 @@
Url https://github.com/go-gitea/gitea
Description The OG look.
Scheme Auto
Verified
Recommended
*/
@import "./theme-gitea-light.css" (prefers-color-scheme: light);

View file

@ -5,7 +5,7 @@
Url https://github.com/go-gitea/gitea
Description The OG look.
Scheme Dark
Verified
Recommended
*/
@import "../chroma/dark.css";

View file

@ -5,7 +5,7 @@
Url https://github.com/go-gitea/gitea
Description The OG look.
Scheme Light
Verified
Recommended
*/
@import "../chroma/light.css";