From 11184d0181fb5be5299a715983da9148c272e495 Mon Sep 17 00:00:00 2001 From: Yakov Date: Tue, 2 Apr 2024 19:47:37 +0000 Subject: [PATCH 1/4] Hide `powered_by` via `OtherConfig` flag --- modules/setting/other.go | 2 ++ modules/templates/helper.go | 3 +++ templates/base/footer_content.tmpl | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/setting/other.go b/modules/setting/other.go index 706cb1e3d9b8e..4ba494765b295 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 24520647499a2..9e770a26065b9 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -106,6 +106,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 f0a7865602f3d..8d0d8e669cca1 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,6 +1,8 @@