Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rss link #3

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,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
Expand Down
1 change: 0 additions & 1 deletion routers/web/repo/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const (

// Activity render the page to show repository latest changes
func Activity(ctx *context.Context) {
AddHeaderCtxData(ctx)
ctx.Data["Title"] = ctx.Tr("repo.activity")
ctx.Data["PageIsActivity"] = true

Expand Down
1 change: 0 additions & 1 deletion routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func MustAllowPulls(ctx *context.Context) {
}

func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption util.OptionalBool) {
AddHeaderCtxData(ctx)
var err error
viewType := ctx.FormString("type")
sortType := ctx.FormString("sort")
Expand Down
1 change: 0 additions & 1 deletion routers/web/repo/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func MustEnableProjects(ctx *context.Context) {

// Projects renders the home page of projects
func Projects(ctx *context.Context) {
AddHeaderCtxData(ctx)
ctx.Data["Title"] = ctx.Tr("repo.project_board")

sortType := ctx.FormTrim("sort")
Expand Down
11 changes: 2 additions & 9 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,23 +696,16 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
}
}

// AddHeaderCtxData adds context data for the repo header
func AddHeaderCtxData(ctx *context.Context) {
// Home render repository home page
func Home(ctx *context.Context) {
if setting.EnableFeed {
isFeed, _, showFeedType := feed.GetFeedType(ctx.Params(":reponame"), ctx.Req)
if isFeed {
feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType)
return
}

ctx.Data["EnableFeed"] = true
ctx.Data["FeedURL"] = ctx.Repo.Repository.Link()
}
}

// Home render repository home page
func Home(ctx *context.Context) {
AddHeaderCtxData(ctx)
checkHomeCodeViewable(ctx)
if ctx.Written() {
return
Expand Down
2 changes: 0 additions & 2 deletions routers/web/repo/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ func wikiContentsByName(ctx *context.Context, commit *git.Commit, wikiName strin
}

func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
AddHeaderCtxData(ctx)

wikiRepo, commit, err := findWikiRepoCommit(ctx)
if err != nil {
if wikiRepo != nil {
Expand Down