mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 22:47:21 +00:00
Refactor web routes (#30519)
Re-organize the routes in web.go and use ctx constants instead of `context.UnitTypes()` --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@ -102,6 +102,18 @@ func NewTemplateContextForWeb(ctx *Context) TemplateContext {
|
||||
tmplCtx["Locale"] = ctx.Base.Locale
|
||||
tmplCtx["AvatarUtils"] = templates.NewAvatarUtils(ctx)
|
||||
tmplCtx["RootData"] = ctx.Data
|
||||
tmplCtx["Consts"] = map[string]any{
|
||||
"RepoUnitTypeCode": unit.TypeCode,
|
||||
"RepoUnitTypeIssues": unit.TypeIssues,
|
||||
"RepoUnitTypePullRequests": unit.TypePullRequests,
|
||||
"RepoUnitTypeReleases": unit.TypeReleases,
|
||||
"RepoUnitTypeWiki": unit.TypeWiki,
|
||||
"RepoUnitTypeExternalWiki": unit.TypeExternalWiki,
|
||||
"RepoUnitTypeExternalTracker": unit.TypeExternalTracker,
|
||||
"RepoUnitTypeProjects": unit.TypeProjects,
|
||||
"RepoUnitTypePackages": unit.TypePackages,
|
||||
"RepoUnitTypeActions": unit.TypeActions,
|
||||
}
|
||||
return tmplCtx
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user