diff options
author | yp05327 <576951401@qq.com> | 2023-10-30 18:11:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 09:11:16 +0000 |
commit | 0e021cd33ee3eb3d8f204bd075e2597b7ec8b391 (patch) | |
tree | 13a3dceaf8c629571633ff6157c324ff35aaee9f /templates/user/overview | |
parent | c8602a8dfa05f653e7de8ed2e677c8967b8688f5 (diff) | |
download | gitea-0e021cd33ee3eb3d8f204bd075e2597b7ec8b391.tar.gz gitea-0e021cd33ee3eb3d8f204bd075e2597b7ec8b391.zip |
Fix display member unit in the menu bar if there are no hidden members in public org (#27795)
Follow #26363.
I missed that org templates also using
`templates/user/overview/header.tmpl`.
You can confirm this problem in https://gitea.com/gitea/-/projects with
anonymous access.
Before: (no login)
![image](https://github.com/go-gitea/gitea/assets/18380374/e285565c-ca65-4b18-9ff7-434c6367c13a)
After:
![image](https://github.com/go-gitea/gitea/assets/18380374/81e7532a-c458-4552-8d75-6896538e42cb)
Diffstat (limited to 'templates/user/overview')
-rw-r--r-- | templates/user/overview/header.tmpl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/user/overview/header.tmpl b/templates/user/overview/header.tmpl index 69a4e9a856..9b6458474e 100644 --- a/templates/user/overview/header.tmpl +++ b/templates/user/overview/header.tmpl @@ -27,14 +27,14 @@ {{end}} {{if .ContextUser.IsOrganization}} - {{if .IsOrganizationMember}} - <a class="item" href="{{$.OrgLink}}/members"> + {{if .NumMembers}} + <a class="{{if $.PageIsOrgMembers}}active {{end}}item" href="{{$.OrgLink}}/members"> {{svg "octicon-person"}} {{ctx.Locale.Tr "org.members"}} - {{if .NumMembers}} - <div class="ui small label">{{.NumMembers}}</div> - {{end}} + <div class="ui small label">{{.NumMembers}}</div> </a> - <a class="item" href="{{$.OrgLink}}/teams"> + {{end}} + {{if .IsOrganizationMember}} + <a class="{{if $.PageIsOrgTeams}}active {{end}}item" href="{{$.OrgLink}}/teams"> {{svg "octicon-people"}} {{ctx.Locale.Tr "org.teams"}} {{if .NumTeams}} <div class="ui small label">{{.NumTeams}}</div> |