diff options
author | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-07-05 17:25:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-05 17:25:04 -0400 |
commit | f1d6a1fffc9d9712f0973b51c850f10d0872a7ea (patch) | |
tree | 990007d38f5d69da4d0c7d4320f6d71856666411 /modules | |
parent | 28c1c90230efd926d1c54a293b57139ff1fc5323 (diff) | |
download | gitea-f1d6a1fffc9d9712f0973b51c850f10d0872a7ea.tar.gz gitea-f1d6a1fffc9d9712f0973b51c850f10d0872a7ea.zip |
Add the ability to have built in themes in Gitea (#4198)
This makes it easier for user who want to theme but
don't have the ability to know how to customize templates
all that is required is a change in a config option
The reason why I chose the DEFAULT_THEME as variable,
as perhaps in the future we will allow users to chose their
theme whon logged in just like we do with languages
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 2 | ||||
-rw-r--r-- | modules/templates/helper.go | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 5230307cab..410cdfbfb5 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -280,6 +280,7 @@ var ( ThemeColorMetaTag string MaxDisplayFileSize int64 ShowUserEmail bool + DefaultTheme string Admin struct { UserPagingNum int @@ -303,6 +304,7 @@ var ( ReactionMaxUserNum: 10, ThemeColorMetaTag: `#6cc644`, MaxDisplayFileSize: 8388608, + DefaultTheme: `gitea`, Admin: struct { UserPagingNum int RepoPagingNum int diff --git a/modules/templates/helper.go b/modules/templates/helper.go index b6c835ad44..8e1a79bc57 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -186,6 +186,9 @@ func NewFuncMap() []template.FuncMap { "ParseDeadline": func(deadline string) []string { return strings.Split(deadline, "|") }, + "DefaultTheme": func() string { + return setting.UI.DefaultTheme + }, }} } |