diff options
author | David Meza <dmeza@users.noreply.github.com> | 2017-09-05 19:28:46 -0500 |
---|---|---|
committer | Chris <ccbrown112@gmail.com> | 2017-09-05 19:28:46 -0500 |
commit | 1605fa5102e7d5d76a02456130097d3ab82c2a2b (patch) | |
tree | 9ac27174b4eff176d3b466acbb036d1fa52b96e3 /utils | |
parent | 7cee7b3342afa4b6845b0574f90c9fdc586c3c34 (diff) | |
download | chat-1605fa5102e7d5d76a02456130097d3ab82c2a2b.tar.gz chat-1605fa5102e7d5d76a02456130097d3ab82c2a2b.tar.bz2 chat-1605fa5102e7d5d76a02456130097d3ab82c2a2b.zip |
Configs for themes in `Display Settings`: hide themes options, hide custom themes, specific list of themes (#7173)
* Add configuration to enable or disable choosing themes in Display Settings. Only for Licensed servers.
* Add configuration to enable or disable choosing custom themes in Display Settings. Only for Licensed servers.
* Add configuration to enable or disable a specific list of themes to choose in Display Settings. Only for Licensed servers.
* Added config value and logic for "DefaultTheme"
* Fix problem with undefined values when the server is not licensed
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/config.go b/utils/config.go index c77d655dc..0a1e0149e 100644 --- a/utils/config.go +++ b/utils/config.go @@ -539,7 +539,6 @@ func getClientConfig(c *model.Config) map[string]string { props["PluginsEnabled"] = strconv.FormatBool(*c.PluginSettings.Enable) if IsLicensed() { - License := License() props["ExperimentalTownSquareIsReadOnly"] = strconv.FormatBool(*c.TeamSettings.ExperimentalTownSquareIsReadOnly) @@ -605,6 +604,13 @@ func getClientConfig(c *model.Config) map[string]string { props["BannerTextColor"] = *c.AnnouncementSettings.BannerTextColor props["AllowBannerDismissal"] = strconv.FormatBool(*c.AnnouncementSettings.AllowBannerDismissal) } + + if *License.Features.ThemeManagement { + props["EnableThemeSelection"] = strconv.FormatBool(*c.ThemeSettings.EnableThemeSelection) + props["DefaultTheme"] = *c.ThemeSettings.DefaultTheme + props["AllowCustomThemes"] = strconv.FormatBool(*c.ThemeSettings.AllowCustomThemes) + props["AllowedThemes"] = strings.Join(c.ThemeSettings.AllowedThemes, ",") + } } return props |