diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-23 07:38:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-22 19:38:25 -0400 |
commit | d44e1565dadd09b4cdbb924479bf6e59a4d3c403 (patch) | |
tree | eaf824f9bc2477f8a4b119056d2ffd26a672c0f7 /routers | |
parent | f1173d6879cb26af21483037fae72542f3088408 (diff) | |
download | gitea-d44e1565dadd09b4cdbb924479bf6e59a4d3c403.tar.gz gitea-d44e1565dadd09b4cdbb924479bf6e59a4d3c403.zip |
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.
## :warning: Breaking
Users can now remove the key `[other].SHOW_FOOTER_BRANDING` from their
app.ini.
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/view.go | 2 | ||||
-rw-r--r-- | routers/web/web.go | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 5a11073ba9..63e534fec0 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -695,7 +695,7 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) { // Home render repository home page func Home(ctx *context.Context) { - if setting.EnableFeed { + if setting.Other.EnableFeed { isFeed, _, showFeedType := feed.GetFeedType(ctx.Params(":reponame"), ctx.Req) if isFeed { feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType) diff --git a/routers/web/web.go b/routers/web/web.go index fc484eed4c..49ea63b191 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -293,7 +293,7 @@ func RegisterRoutes(m *web.Route) { } sitemapEnabled := func(ctx *context.Context) { - if !setting.EnableSitemap { + if !setting.Other.EnableSitemap { ctx.Error(http.StatusNotFound) return } @@ -307,7 +307,7 @@ func RegisterRoutes(m *web.Route) { } feedEnabled := func(ctx *context.Context) { - if !setting.EnableFeed { + if !setting.Other.EnableFeed { ctx.Error(http.StatusNotFound) return } @@ -706,7 +706,7 @@ func RegisterRoutes(m *web.Route) { default: context_service.UserAssignmentWeb()(ctx) if !ctx.Written() { - ctx.Data["EnableFeed"] = setting.EnableFeed + ctx.Data["EnableFeed"] = setting.Other.EnableFeed user.Profile(ctx) } } @@ -1205,7 +1205,7 @@ func RegisterRoutes(m *web.Route) { m.Get(".rss", feedEnabled, repo.TagsListFeedRSS) m.Get(".atom", feedEnabled, repo.TagsListFeedAtom) }, func(ctx *context.Context) { - ctx.Data["EnableFeed"] = setting.EnableFeed + ctx.Data["EnableFeed"] = setting.Other.EnableFeed }, repo.MustBeNotEmpty, reqRepoCodeReader, context.RepoRefByType(context.RepoRefTag, true)) m.Group("/releases", func() { m.Get("/", repo.Releases) @@ -1214,7 +1214,7 @@ func RegisterRoutes(m *web.Route) { m.Get(".rss", feedEnabled, repo.ReleasesFeedRSS) m.Get(".atom", feedEnabled, repo.ReleasesFeedAtom) }, func(ctx *context.Context) { - ctx.Data["EnableFeed"] = setting.EnableFeed + ctx.Data["EnableFeed"] = setting.Other.EnableFeed }, repo.MustBeNotEmpty, reqRepoReleaseReader, context.RepoRefByType(context.RepoRefTag, true)) m.Get("/releases/attachments/{uuid}", repo.GetAttachment, repo.MustBeNotEmpty, reqRepoReleaseReader) m.Group("/releases", func() { |