summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGusted <postmaster@gusted.xyz>2024-02-21 12:42:12 +0100
committerGusted <postmaster@gusted.xyz>2024-02-21 12:48:26 +0100
commit6fbfe441decc018a122b0b66185002db92b404a2 (patch)
tree24e6abaadc16a7cf6e58512961d945649f74e0e1 /templates
parentMerge pull request '[gitea] cherry-pick' (#2397) from earl-warren/forgejo:wip... (diff)
downloadforgejo-6fbfe441decc018a122b0b66185002db92b404a2.tar.xz
forgejo-6fbfe441decc018a122b0b66185002db92b404a2.zip
[BUG] Load `AllUnitsEnabled` when necessary
- In order to determine if the "Add more..." tab should be shown, the template has to know if the repository has all units enabled, this is done in the repository header which can be shown for quite a lot of pages (code, issues, projects, actions etc.) - This was previously set in the `RepoRefByType` function, which would be called by pages such as code, issues and releases, but it was not being called for all pages such as actions, packages and wiki. Which would in turn incorrectly show the "Add more..." button when it shouldn't. - Now call it from the template itself, so the value is 'always' loaded when necessary.
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/header.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 086ffd85ff..2a3167f982 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -219,7 +219,7 @@
{{end}}
{{if .Permission.IsAdmin}}
- {{if not .AllUnitsEnabled}}
+ {{if not (.Repository.AllUnitsEnabled ctx)}}
<a class="{{if .PageIsRepoSettingsUnits}}active {{end}}item" href="{{.RepoLink}}/settings/units">
{{svg "octicon-diff-added"}} {{ctx.Locale.Tr "repo.settings.units.add_more"}}
</a>