-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Rename the default themes to gitea-light, gitea-dark, gitea-auto #27419
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
Changes from all commits
6972daa
22d5539
ad15442
8236639
7d054ad
35b7f19
f4a07f3
454e475
fa0ec53
ae579f9
ec00837
0a6bc05
9ae37a8
6f27843
e34f2c3
a6b176f
4bb8ac1
ad21ba1
c2eff82
913b659
9f4e6c7
d8e0f14
4073392
5ff07a9
dbb6ae8
f6917af
b97ab34
c727920
26b4cc0
818d9db
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package v1_22 //nolint | ||
|
||
import ( | ||
"xorm.io/xorm" | ||
) | ||
|
||
func RenameUserThemes(x *xorm.Engine) error { | ||
sess := x.NewSession() | ||
defer sess.Close() | ||
|
||
if err := sess.Begin(); err != nil { | ||
return err | ||
} | ||
|
||
if _, err := sess.Exec("UPDATE `user` SET `theme` = 'gitea-light' WHERE `theme` = 'gitea'"); err != nil { | ||
return err | ||
} | ||
if _, err := sess.Exec("UPDATE `user` SET `theme` = 'gitea-dark' WHERE `theme` = 'arc-green'"); err != nil { | ||
return err | ||
} | ||
if _, err := sess.Exec("UPDATE `user` SET `theme` = 'gitea-auto' WHERE `theme` = 'auto'"); err != nil { | ||
return err | ||
} | ||
|
||
return sess.Commit() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{AssetVersion}}"> | ||
{{if .IsSigned}} | ||
{{if ne .SignedUser.Theme "gitea"}} | ||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme | PathEscape}}.css?v={{AssetVersion}}"> | ||
{{end}} | ||
{{else if ne DefaultTheme "gitea"}} | ||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme | PathEscape}}.css?v={{AssetVersion}}"> | ||
{{end}} | ||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{ThemeName .SignedUser | PathEscape}}.css?v={{AssetVersion}}"> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{{/* This page should only depend the minimal template functions/variables, to avoid triggering new panics. | ||
* base template functions: AppName, AssetUrlPrefix, AssetVersion, AppSubUrl, DefaultTheme, Str2html | ||
* base template functions: AppName, AssetUrlPrefix, AssetVersion, AppSubUrl, ThemeName, Str2html | ||
* locale | ||
* Flash | ||
* ErrorMsg | ||
* SignedUser (optional) | ||
*/}} | ||
<!DOCTYPE html> | ||
<html lang="{{.locale.Lang}}" class="theme-{{if .SignedUser.Theme}}{{.SignedUser.Theme}}{{else}}{{DefaultTheme}}{{end}}"> | ||
<html lang="{{.locale.Lang}}" data-theme="{{ThemeName .SignedUser}}"> | ||
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. What is the 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. Not used at all by our first-party code, but it's useful to have imho, if only for customization. Previously the class was used at one point in time for Monaco, but that has been replaced by |
||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Internal Server Error - {{AppName}}</title> | ||
|
Uh oh!
There was an error while loading. Please reload this page.