From 56006da34b0e580e1585439b1ee603f8cbe36a48 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 18 Nov 2015 22:32:31 +0100 Subject: [PATCH 1/2] fix #1957 - disable version display This allows the admin to disable the version information about gogs and go in use in the footer. --- conf/app.ini | 2 ++ modules/middleware/context.go | 1 + modules/setting/setting.go | 2 ++ templates/base/footer.tmpl | 6 +++--- templates/ng/base/footer.tmpl | 6 +++--- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 5c7ce6983421..d9d29c9ef9fc 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -334,3 +334,5 @@ it-IT = it [other] SHOW_FOOTER_BRANDING = false +; Show version information about gogs and go in the footer +SHOW_FOOTER_VERSION = true diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 3910a205210a..4839ccf99ed2 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 a77267228f5d..fac01990748a 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")) } diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 686b82f24d16..f3eb25061822 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -2,7 +2,7 @@ @@ -46,4 +46,4 @@ - \ No newline at end of file + diff --git a/templates/ng/base/footer.tmpl b/templates/ng/base/footer.tmpl index bafcc46ef736..695a145f7256 100644 --- a/templates/ng/base/footer.tmpl +++ b/templates/ng/base/footer.tmpl @@ -1,7 +1,7 @@ - \ No newline at end of file + From e347736c9eadc458a330359c361f19c4193e5f4b Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 18 Nov 2015 23:12:42 +0100 Subject: [PATCH 2/2] 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(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index fac01990748a..c2b56b5b4c16 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")) }