From b0ff1a17a4d733bdc527d1c62db1ef36d9d3321e Mon Sep 17 00:00:00 2001 From: Yakov Date: Wed, 3 Apr 2024 09:01:50 -0700 Subject: [PATCH] Add `[other].SHOW_FOOTER_POWERED_BY` setting to hide `Powered by` (#30253) This allows you to hide the "Powered by" text in footer via `SHOW_FOOTER_POWERED_BY` flag in configuration. --------- Co-authored-by: silverwind (cherry picked from commit 609a627a44dbcb7b630ff51ce9f4b9f448b48ca8) Conflicts: - docs/content/administration/config-cheat-sheet.en-us.md - docs/content/administration/config-cheat-sheet.zh-cn.md Removed both, they're Gitea specific. - templates/base/footer_content.tmpl Applied the change manually, keeping the Forgejo footer. --- custom/conf/app.example.ini | 2 ++ modules/setting/other.go | 2 ++ modules/templates/helper.go | 3 +++ templates/base/footer_content.tmpl | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index d00dc4eb64..304eb3af75 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -2331,6 +2331,8 @@ LEVEL = Info ;SHOW_FOOTER_VERSION = true ;; Show template execution time in the footer ;SHOW_FOOTER_TEMPLATE_LOAD_TIME = true +;; Show the "powered by" text in the footer +;SHOW_FOOTER_POWERED_BY = true ;; Generate sitemap. Defaults to `true`. ;ENABLE_SITEMAP = true ;; Enable/Disable RSS/Atom feed diff --git a/modules/setting/other.go b/modules/setting/other.go index 706cb1e3d9..4ba494765b 100644 --- a/modules/setting/other.go +++ b/modules/setting/other.go @@ -8,6 +8,7 @@ import "code.gitea.io/gitea/modules/log" type OtherConfig struct { ShowFooterVersion bool ShowFooterTemplateLoadTime bool + ShowFooterPoweredBy bool EnableFeed bool EnableSitemap bool } @@ -15,6 +16,7 @@ type OtherConfig struct { var Other = OtherConfig{ ShowFooterVersion: true, ShowFooterTemplateLoadTime: true, + ShowFooterPoweredBy: true, EnableSitemap: true, EnableFeed: true, } diff --git a/modules/templates/helper.go b/modules/templates/helper.go index c9799a38ec..8874351d1c 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -109,6 +109,9 @@ func NewFuncMap() template.FuncMap { "ShowFooterTemplateLoadTime": func() bool { return setting.Other.ShowFooterTemplateLoadTime }, + "ShowFooterPoweredBy": func() bool { + return setting.Other.ShowFooterPoweredBy + }, "AllowedReactions": func() []string { return setting.UI.Reactions }, diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 75b7845310..5db7464480 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,6 +1,8 @@