Skip to content

Commit ca5722a

Browse files
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: <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: wxiaoguang <[email protected]>
1 parent ff2f479 commit ca5722a

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
@@ -537,6 +537,11 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
537537
ctx.Data["RepoLink"] = ctx.Repo.RepoLink
538538
ctx.Data["RepoRelPath"] = ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name
539539

540+
if setting.EnableFeed {
541+
ctx.Data["EnableFeed"] = true
542+
ctx.Data["FeedURL"] = ctx.Repo.RepoLink
543+
}
544+
540545
unit, err := ctx.Repo.Repository.GetUnit(ctx, unit_model.TypeExternalTracker)
541546
if err == nil {
542547
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
@@ -711,9 +711,6 @@ func Home(ctx *context.Context) {
711711
feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType)
712712
return
713713
}
714-
715-
ctx.Data["EnableFeed"] = true
716-
ctx.Data["FeedURL"] = ctx.Repo.Repository.Link()
717714
}
718715

719716
checkHomeCodeViewable(ctx)

0 commit comments

Comments
 (0)