diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 15 | ||||
-rw-r--r-- | modules/templates/helper.go | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 069a3556da..bf2ed6111e 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -181,6 +181,12 @@ var ( SearchRepoDescription bool UseServiceWorker bool + Notification struct { + MinTimeout time.Duration + TimeoutStep time.Duration + MaxTimeout time.Duration + } `ini:"ui.notification"` + Admin struct { UserPagingNum int RepoPagingNum int @@ -209,6 +215,15 @@ var ( DefaultTheme: `gitea`, Themes: []string{`gitea`, `arc-green`}, Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`}, + Notification: struct { + MinTimeout time.Duration + TimeoutStep time.Duration + MaxTimeout time.Duration + }{ + MinTimeout: 10 * time.Second, + TimeoutStep: 10 * time.Second, + MaxTimeout: 60 * time.Second, + }, Admin: struct { UserPagingNum int RepoPagingNum int diff --git a/modules/templates/helper.go b/modules/templates/helper.go index b5b4987427..8112880f43 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -278,6 +278,13 @@ func NewFuncMap() []template.FuncMap { return "" } }, + "NotificationSettings": func() map[string]int { + return map[string]int{ + "MinTimeout": int(setting.UI.Notification.MinTimeout / time.Millisecond), + "TimeoutStep": int(setting.UI.Notification.TimeoutStep / time.Millisecond), + "MaxTimeout": int(setting.UI.Notification.MaxTimeout / time.Millisecond), + } + }, "contain": func(s []int64, id int64) bool { for i := 0; i < len(s); i++ { if s[i] == id { |