From 56006da34b0e580e1585439b1ee603f8cbe36a48 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 18 Nov 2015 22:32:31 +0100 Subject: fix #1957 - disable version display This allows the admin to disable the version information about gogs and go in use in the footer. --- modules/middleware/context.go | 1 + modules/setting/setting.go | 2 ++ 2 files changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 3910a205..4839ccf9 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -245,6 +245,7 @@ func Contexter() macaron.Handler { ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton ctx.Data["ShowFooterBranding"] = setting.ShowFooterBranding + ctx.Data["ShowFooterVersion"] = setting.ShowFooterVersion c.Map(ctx) } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index a7726722..fac01990 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -178,6 +178,7 @@ var ( // Other settings. ShowFooterBranding bool + ShowFooterVersion bool // Global setting objects. Cfg *ini.File @@ -425,6 +426,7 @@ func NewContext() { dateLangs = Cfg.Section("i18n.datelang").KeysHash() ShowFooterBranding = Cfg.Section("other").Key("SHOW_FOOTER_BRANDING").MustBool() + EnableShowVersion = Cfg.Section("other").Key("ENABLE_SHOW_VERSION").MustBool() HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) } -- cgit v1.2.3 From e347736c9eadc458a330359c361f19c4193e5f4b Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 18 Nov 2015 23:12:42 +0100 Subject: fix old naming This is the old naming of the variable and I forgot to fix it. It now works and is tested. --- modules/setting/setting.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index fac01990..c2b56b5b 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -426,7 +426,7 @@ func NewContext() { dateLangs = Cfg.Section("i18n.datelang").KeysHash() ShowFooterBranding = Cfg.Section("other").Key("SHOW_FOOTER_BRANDING").MustBool() - EnableShowVersion = Cfg.Section("other").Key("ENABLE_SHOW_VERSION").MustBool() + ShowFooterVersion = Cfg.Section("other").Key("SHOW_FOOTER_VERSION").MustBool() HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) } -- cgit v1.2.3