From 10b9a6df0d09b9865f7bd705b70b414d07d3f320 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Wed, 9 Dec 2020 02:58:38 +0100 Subject: [PATCH] Don't show dashboard links for globally disabled repo units (#13908) This applias the same checks from base/head_navbar.tmpl to user/dashboard/navbar.tmpl so no links are shown for globally disabled repo units Co-authored-by: 6543 <6543@obermui.de> --- templates/user/dashboard/navbar.tmpl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index d80ac2e88..25670f470 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -46,16 +46,20 @@ {{svg "octicon-rss"}} {{.i18n.Tr "activities"}} + {{if not .UnitIssuesGlobalDisabled}} {{svg "octicon-issue-opened"}} {{.i18n.Tr "issues"}} + {{end}} + {{if not .UnitPullsGlobalDisabled}} {{svg "octicon-git-pull-request"}} {{.i18n.Tr "pull_requests"}} - {{if .ShowMilestonesDashboardPage}} - - {{svg "octicon-milestone"}} {{.i18n.Tr "milestones"}} - + {{end}} + {{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}} + + {{svg "octicon-milestone"}} {{.i18n.Tr "milestones"}} + {{end}}