-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add theme selector button to footer #27576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,17 @@ | |
{{end}} | ||
</div> | ||
<div class="right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}"> | ||
<div class="ui dropdown upward"> | ||
{{$currentTheme := ThemeName .SignedUser}} | ||
<span class="flex-text-inline">{{svg (ThemeIcon $currentTheme) 14}} {{$currentTheme}}</span> | ||
<div class="menu theme-menu"> | ||
{{range Themes}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do that, I think it might also be a good idea to sort the themes alphabetically beforehand (once, on Gitea startup). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sorting is a good idea, can add. Not sure if really warranted to store in-memory because sorting a small array is fast, but can do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, we store the array already, so I don't see why it would consume extra memory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, we can just sort |
||
<a data-value="{{.}}" class="item {{if eq $currentTheme .}}active selected{{end}}"> | ||
{{svg (ThemeIcon .) 14}} {{.}} | ||
</a> | ||
{{end}} | ||
</div> | ||
</div> | ||
<div class="ui dropdown upward language"> | ||
<span class="flex-text-inline">{{svg "octicon-globe" 14}} {{ctx.Locale.LangName}}</span> | ||
<div class="menu language-menu"> | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the switch way of writing, but gitea doesn't seem to have a normalized way of writing this, so it's the same with either one of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will go with the JSON config, making this switch unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> Improve theme display #30671
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that seems nice, waiting for that PR here.