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:
parent
4f276a3363
commit
3e2e76e248
23 changed files with 394 additions and 377 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue