Refactor setting.Other and remove unused SHOW_FOOTER_BRANDING (#24270)

The `SHOW_FOOTER_BRANDING` came from year 2015, and it seems nobody ever
uses it. It only shows an GitHub icon which seems unrelated to Gitea, it
doesn't do what document says. So, remove it.

## ⚠️ Breaking

Users can now remove the key `[other].SHOW_FOOTER_BRANDING` from their
app.ini.
This commit is contained in:
wxiaoguang authored and GitHub committed 2023-04-22 19:38:25 -04:00
1 parent f1173d6879
commit d44e1565da
11 files changed
+25 -28

No files matched your search

+14 -9
View File
@@ -3,20 +3,25 @@
package setting
var (
// Other settings
ShowFooterBranding bool
import "code.gitea.io/gitea/modules/log"
type OtherConfig struct {
ShowFooterVersion bool
ShowFooterTemplateLoadTime bool
EnableFeed bool
EnableSitemap bool
)
}
var Other = OtherConfig{
ShowFooterVersion: true,
ShowFooterTemplateLoadTime: true,
EnableSitemap: true,
EnableFeed: true,
}
func loadOtherFrom(rootCfg ConfigProvider) {
sec := rootCfg.Section("other")
ShowFooterBranding = sec.Key("SHOW_FOOTER_BRANDING").MustBool(false)
ShowFooterVersion = sec.Key("SHOW_FOOTER_VERSION").MustBool(true)
ShowFooterTemplateLoadTime = sec.Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true)
EnableSitemap = sec.Key("ENABLE_SITEMAP").MustBool(true)
EnableFeed = sec.Key("ENABLE_FEED").MustBool(true)
if err := sec.MapTo(&Other); err != nil {
log.Fatal("Failed to map [other] settings: %v", err)
}
}