summaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-06-18 08:51:13 +0800
committerGitHub <noreply@github.com>2024-06-18 00:51:13 +0000
commit37a4b233a0a4ca516b90e0c8e15d8dafb8d13358 (patch)
tree906fc88c06e46d164157707886833332aebcf5c8 /templates/base
parentd32648b204395fe3590ca2de5f38f0f97da510aa (diff)
downloadgitea-37a4b233a0a4ca516b90e0c8e15d8dafb8d13358.tar.gz
gitea-37a4b233a0a4ca516b90e0c8e15d8dafb8d13358.zip
Refactor repo unit "disabled" check (#31389)
1. There are already global "unit consts", no need to use context data, which is fragile 2. Remove the "String()" method from "unit", it would only cause rendering problems in templates --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/head_navbar.tmpl6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl
index 4889924819..7be2d96d74 100644
--- a/templates/base/head_navbar.tmpl
+++ b/templates/base/head_navbar.tmpl
@@ -35,13 +35,13 @@
{{if and .IsSigned .MustChangePassword}}
{{/* No links */}}
{{else if .IsSigned}}
- {{if not .UnitIssuesGlobalDisabled}}
+ {{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
{{end}}
- {{if not .UnitPullsGlobalDisabled}}
+ {{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
{{end}}
- {{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
+ {{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
{{if .ShowMilestonesDashboardPage}}
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
{{end}}