Skip to content

Commit 5b7df68

Browse files
GiteaBotsilverwind
andauthored
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: <img width="806" alt="image" src="https://user-images.githubusercontent.com/115237/229639615-9cc00e75-3a26-4ff4-a6f2-316c1fccc596.png"> After: <img width="815" alt="Screenshot 2023-04-04 at 00 16 17" src="https://user-images.githubusercontent.com/115237/229639201-2e1c015b-1f13-46d4-aa14-e7a82fab3982.png"> Co-authored-by: silverwind <[email protected]>
1 parent 833a4b1 commit 5b7df68

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/context/repo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,11 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
529529
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
530530
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name
531531

532+
if setting.EnableFeed {
533+
ctx.Data["EnableFeed"] = true
534+
ctx.Data["FeedURL"] = ctx.Repo.RepoLink
535+
}
536+
532537
unit, err := ctx.Repo.Repository.GetUnit(ctx, unit_model.TypeExternalTracker)
533538
if err == nil {
534539
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL

routers/web/repo/view.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,6 @@ func Home(ctx *context.Context) {
707707
feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType)
708708
return
709709
}
710-
711-
ctx.Data["EnableFeed"] = true
712-
ctx.Data["FeedURL"] = ctx.Repo.Repository.Link()
713710
}
714711

715712
checkHomeCodeViewable(ctx)

0 commit comments

Comments
 (0)