Skip to content

Commit 10b9a6d

Browse files
jpraet6543
andauthored
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 <[email protected]>
1 parent c05701d commit 10b9a6d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

templates/user/dashboard/navbar.tmpl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,20 @@
4646
<a class="{{if .PageIsNews}}active{{end}} item" style="margin-left: auto" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/dashboard">
4747
{{svg "octicon-rss"}}&nbsp;{{.i18n.Tr "activities"}}
4848
</a>
49+
{{if not .UnitIssuesGlobalDisabled}}
4950
<a class="{{if .PageIsIssues}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/issues">
5051
{{svg "octicon-issue-opened"}}&nbsp;{{.i18n.Tr "issues"}}
5152
</a>
53+
{{end}}
54+
{{if not .UnitPullsGlobalDisabled}}
5255
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/pulls">
5356
{{svg "octicon-git-pull-request"}}&nbsp;{{.i18n.Tr "pull_requests"}}
5457
</a>
55-
{{if .ShowMilestonesDashboardPage}}
56-
<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/milestones">
57-
{{svg "octicon-milestone"}}&nbsp;{{.i18n.Tr "milestones"}}
58-
</a>
58+
{{end}}
59+
{{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
60+
<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/milestones">
61+
{{svg "octicon-milestone"}}&nbsp;{{.i18n.Tr "milestones"}}
62+
</a>
5963
{{end}}
6064
<div class="item">
6165
<a class="ui blue basic button" href="{{.ContextUser.HomeLink}}" title='{{.i18n.Tr "home.view_home" .ContextUser.Name}}'>

0 commit comments

Comments
 (0)