diff options
author | Wim <wim@42.be> | 2019-05-08 10:41:35 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-05-08 11:41:35 +0300 |
commit | 4508380cf7937aef0bf6f99fe3eefb6c530e38e3 (patch) | |
tree | 28d832a36e5aced26dce671591c58a1b1a00f22e /modules | |
parent | a84f10ad1afb8b3dcfa75093891d85f6f163715e (diff) | |
download | gitea-4508380cf7937aef0bf6f99fe3eefb6c530e38e3.tar.gz gitea-4508380cf7937aef0bf6f99fe3eefb6c530e38e3.zip |
Show full name if DefaultShowFullName setting activated (#6710)
Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section.
If enabled the full name will be shown (unless it's empty, then
the default username will be used)
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 692fb9820a..687f01bc29 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -176,6 +176,7 @@ var ( ThemeColorMetaTag string MaxDisplayFileSize int64 ShowUserEmail bool + DefaultShowFullName bool DefaultTheme string Themes []string @@ -918,6 +919,7 @@ func NewContext() { ShowFooterTemplateLoadTime = Cfg.Section("other").Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true) UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true) + UI.DefaultShowFullName = Cfg.Section("ui").Key("DEFAULT_SHOW_FULL_NAME").MustBool(false) HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 3176684d82..24a383252b 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -63,6 +63,9 @@ func NewFuncMap() []template.FuncMap { "DisableGravatar": func() bool { return setting.DisableGravatar }, + "DefaultShowFullName": func() bool { + return setting.UI.DefaultShowFullName + }, "ShowFooterTemplateLoadTime": func() bool { return setting.ShowFooterTemplateLoadTime }, |