Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053)
When a team have no code unit permission of a repository, the member of the team should not view activity contributors, recent commits and code frequrency. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 49899070cd600e7b7bd31a750f4d49de1722db23)
This commit is contained in:
parent
adc2a215c1
commit
b296354873
4 changed files with 15 additions and 26 deletions
|
@ -1,14 +1,18 @@
|
|||
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}
|
||||
|
||||
<div class="ui fluid vertical menu">
|
||||
<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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue