From 5b7df685554434d95d812191bf6d093d82993758 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 7 Apr 2023 08:55:30 -0400 Subject: [PATCH] Ensure RSS icon is present on all repo tabs (#23904) (#23973) Backport #23904 by @silverwind 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: silverwind --- 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 e4ac65e961..15c88d0b57 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -529,6 +529,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 8663e11382..8669397027 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -707,9 +707,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)