mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +00:00
Fix the settings tab highlighting
When visiting a repos `/settings/units` page, highlight the active tab
properly: "Add more..." if the tab is displayed, or "Settings"
otherwise.
Fixes #3188.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 65ed86e396
)
This commit is contained in:
parent
89d751ef1b
commit
fd5abfd244
2 changed files with 96 additions and 1 deletions
|
@ -174,12 +174,14 @@
|
|||
{{end}}
|
||||
|
||||
{{if .Permission.IsAdmin}}
|
||||
{{$highlightSettings := true}}
|
||||
{{if and .SignedUser.EnableRepoUnitHints (not (.Repository.AllUnitsEnabled ctx))}}
|
||||
{{$highlightSettings = false}}
|
||||
<a class="{{if .PageIsRepoSettingsUnits}}active {{end}}item" href="{{.RepoLink}}/settings/units">
|
||||
{{svg "octicon-diff-added"}} {{ctx.Locale.Tr "repo.settings.units.add_more"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if and .PageIsRepoSettings (not .PageIsRepoSettingsUnits)}}active {{end}} item" href="{{.RepoLink}}/settings">
|
||||
<a class="{{if and .PageIsRepoSettings (or $highlightSettings (not .PageIsRepoSettingsUnits))}}active {{end}} item" href="{{.RepoLink}}/settings">
|
||||
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue