Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide code related setting options in repository when code unit is disabled #28631

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Prev Previous commit
Next Next commit
webhook is shared by code and other units
  • Loading branch information
lunny committed Jan 7, 2024
commit 6d2b2b7c24dcf2c53dae97c229c1262e41bcc963
10 changes: 5 additions & 5 deletions templates/repo/settings/navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
{{ctx.Locale.Tr "repo.settings.collaboration"}}
</a>
{{if not DisableWebhooks}}
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
{{ctx.Locale.Tr "repo.settings.hooks"}}
</a>
{{end}}
{{if and (.Repository.UnitEnabled $.Context $.UnitTypeCode) (not .Repository.IsEmpty)}}
<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
{{ctx.Locale.Tr "repo.settings.branches"}}
</a>
<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
{{ctx.Locale.Tr "repo.settings.tags"}}
</a>
{{if not DisableWebhooks}}
<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
{{ctx.Locale.Tr "repo.settings.hooks"}}
</a>
{{end}}
{{if .SignedUser.CanEditGitHook}}
<a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git">
{{ctx.Locale.Tr "repo.settings.githooks"}}
Expand Down