summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/config.go34
-rw-r--r--model/license.go6
2 files changed, 40 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index f3ce6f2f1..4e3a3f7cc 100644
--- a/model/config.go
+++ b/model/config.go
@@ -292,6 +292,14 @@ type SupportSettings struct {
SupportEmail *string
}
+type AnnouncementSettings struct {
+ EnableBanner *bool
+ BannerText *string
+ BannerColor *string
+ BannerTextColor *string
+ AllowBannerDismissal *bool
+}
+
type TeamSettings struct {
SiteName string
MaxUsersPerTeam int
@@ -429,6 +437,7 @@ type Config struct {
RateLimitSettings RateLimitSettings
PrivacySettings PrivacySettings
SupportSettings SupportSettings
+ AnnouncementSettings AnnouncementSettings
GitLabSettings SSOSettings
GoogleSettings SSOSettings
Office365Settings SSOSettings
@@ -825,6 +834,31 @@ func (o *Config) SetDefaults() {
*o.SupportSettings.SupportEmail = SUPPORT_SETTINGS_DEFAULT_SUPPORT_EMAIL
}
+ if o.AnnouncementSettings.EnableBanner == nil {
+ o.AnnouncementSettings.EnableBanner = new(bool)
+ *o.AnnouncementSettings.EnableBanner = false
+ }
+
+ if o.AnnouncementSettings.BannerText == nil {
+ o.AnnouncementSettings.BannerText = new(string)
+ *o.AnnouncementSettings.BannerText = ""
+ }
+
+ if o.AnnouncementSettings.BannerColor == nil {
+ o.AnnouncementSettings.BannerColor = new(string)
+ *o.AnnouncementSettings.BannerColor = "#f2a93b"
+ }
+
+ if o.AnnouncementSettings.BannerTextColor == nil {
+ o.AnnouncementSettings.BannerTextColor = new(string)
+ *o.AnnouncementSettings.BannerTextColor = "#333333"
+ }
+
+ if o.AnnouncementSettings.AllowBannerDismissal == nil {
+ o.AnnouncementSettings.AllowBannerDismissal = new(bool)
+ *o.AnnouncementSettings.AllowBannerDismissal = true
+ }
+
if o.LdapSettings.Enable == nil {
o.LdapSettings.Enable = new(bool)
*o.LdapSettings.Enable = false
diff --git a/model/license.go b/model/license.go
index 558cd43fa..443d78282 100644
--- a/model/license.go
+++ b/model/license.go
@@ -50,6 +50,7 @@ type Features struct {
SAML *bool `json:"saml"`
PasswordRequirements *bool `json:"password_requirements"`
ElasticSearch *bool `json:"elastic_search"`
+ Announcement *bool `json:"announcement"`
// after we enabled more features for webrtc we'll need to control them with this
FutureFeatures *bool `json:"future_features"`
}
@@ -142,6 +143,11 @@ func (f *Features) SetDefaults() {
f.ElasticSearch = new(bool)
*f.ElasticSearch = *f.FutureFeatures
}
+
+ if f.Announcement == nil {
+ f.Announcement = new(bool)
+ *f.Announcement = true
+ }
}
func (l *License) IsExpired() bool {