aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/navbar.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/navbar.tmpl')
-rw-r--r--templates/repo/navbar.tmpl23
1 files changed, 14 insertions, 9 deletions
diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl
index b2471dc17e..e004c5254b 100644
--- a/templates/repo/navbar.tmpl
+++ b/templates/repo/navbar.tmpl
@@ -1,14 +1,19 @@
+{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
+
<div class="ui fluid vertical menu">
+ {{/* the default activity page "pulse" could work with any permission: code, issue, pr, release*/}}
<a class="{{if .PageIsPulse}}active {{end}}item" href="{{.RepoLink}}/activity">
{{ctx.Locale.Tr "repo.activity.navbar.pulse"}}
</a>
- <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
- {{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
- </a>
- <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency">
- {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}}
- </a>
- <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits">
- {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}}
- </a>
+ {{if $canReadCode}}
+ <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
+ {{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
+ </a>
+ <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency">
+ {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}}
+ </a>
+ <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits">
+ {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}}
+ </a>
+ {{end}}
</div>