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

+1 -2
View File
@@ -741,8 +741,7 @@ func Contexter(ctx context.Context) func(next http.Handler) http.Handler {
ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton
ctx.Data["ShowMilestonesDashboardPage"] = setting.Service.ShowMilestonesDashboardPage
ctx.Data["ShowFooterBranding"] = setting.ShowFooterBranding
ctx.Data["ShowFooterVersion"] = setting.ShowFooterVersion
ctx.Data["ShowFooterVersion"] = setting.Other.ShowFooterVersion
ctx.Data["EnableSwagger"] = setting.API.EnableSwagger
ctx.Data["EnableOpenIDSignIn"] = setting.Service.EnableOpenIDSignIn
+2 -2
View File
@@ -452,7 +452,7 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
userName := ctx.Params(":username")
repoName := ctx.Params(":reponame")
repoName = strings.TrimSuffix(repoName, ".git")
if setting.EnableFeed {
if setting.Other.EnableFeed {
repoName = strings.TrimSuffix(repoName, ".rss")
repoName = strings.TrimSuffix(repoName, ".atom")
}
@@ -540,7 +540,7 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name
if setting.EnableFeed {
if setting.Other.EnableFeed {
ctx.Data["EnableFeed"] = true
ctx.Data["FeedURL"] = ctx.Repo.RepoLink
}