From ca5722a0fae6cc16dc99021176596970bbf29caf Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 7 Apr 2023 10:48:23 +0200 Subject: [PATCH] Ensure RSS icon is present on all repo tabs (#23904) Previously, not all repo tabs had shown the RSS icon in the repo header because the context data was not being set. Added this context data in a new function. Before: image After: Screenshot 2023-04-04 at 00 16 17 --------- Co-authored-by: wxiaoguang --- modules/context/repo.go | 5 +++++ routers/web/repo/view.go | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/context/repo.go b/modules/context/repo.go index 9d45a6019..8b4d0c1bf 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -537,6 +537,11 @@ 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 { + ctx.Data["EnableFeed"] = true + ctx.Data["FeedURL"] = ctx.Repo.RepoLink + } + unit, err := ctx.Repo.Repository.GetUnit(ctx, unit_model.TypeExternalTracker) if err == nil { ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 2a57f8ef3..5bf961f41 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -711,9 +711,6 @@ func Home(ctx *context.Context) { feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType) return } - - ctx.Data["EnableFeed"] = true - ctx.Data["FeedURL"] = ctx.Repo.Repository.Link() } checkHomeCodeViewable(ctx)