diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-04-17 16:31:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 08:31:37 +0000 |
commit | 3e2e76e2484c79715ab5d56f268ea3ad8e1c259b (patch) | |
tree | ec1a5e2dd015a17a5833abe3bdc758095ac53250 /templates/repo/pulse.tmpl | |
parent | 4f276a336355c4bf999034fb79f0fe5c967ceb50 (diff) | |
download | gitea-3e2e76e2484c79715ab5d56f268ea3ad8e1c259b.tar.gz gitea-3e2e76e2484c79715ab5d56f268ea3ad8e1c259b.zip |
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>
Diffstat (limited to 'templates/repo/pulse.tmpl')
-rw-r--r-- | templates/repo/pulse.tmpl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl index bc25563d48..e68109b755 100644 --- a/templates/repo/pulse.tmpl +++ b/templates/repo/pulse.tmpl @@ -18,10 +18,10 @@ </div> </h2> -{{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} +{{if (or (.Permission.CanRead ctx.Consts.RepoUnitTypeIssues) (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests))}} <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4> <div class="ui attached segment two column grid"> - {{if .Permission.CanRead $.UnitTypePullRequests}} + {{if .Permission.CanRead ctx.Consts.RepoUnitTypePullRequests}} <div class="column"> {{if gt .Activity.ActivePRCount 0}} <div class="stats-table"> @@ -38,7 +38,7 @@ {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount}} </div> {{end}} - {{if .Permission.CanRead $.UnitTypeIssues}} + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} <div class="column"> {{if gt .Activity.ActiveIssueCount 0}} <div class="stats-table"> @@ -57,7 +57,7 @@ {{end}} </div> <div class="ui attached segment horizontal segments"> - {{if .Permission.CanRead $.UnitTypePullRequests}} + {{if .Permission.CanRead ctx.Consts.RepoUnitTypePullRequests}} <a href="#merged-pull-requests" class="ui attached segment text center"> <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br> {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} @@ -67,7 +67,7 @@ {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} </a> {{end}} - {{if .Permission.CanRead $.UnitTypeIssues}} + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} <a href="#closed-issues" class="ui attached segment text center"> <span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br> {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} @@ -80,7 +80,7 @@ </div> {{end}} -{{if .Permission.CanRead $.UnitTypeCode}} +{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}} {{if eq .Activity.Code.CommitCountInAllBranches 0}} <div class="ui center aligned segment"> <h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4> |