diff options
author | yp05327 | 2023-03-09 00:18:10 +0900 |
---|---|---|
committer | GitHub | 2023-03-08 23:18:10 +0800 |
commit | d949d8e074407a96dbcfa98a71ccd80527b5ad78 (patch) | |
tree | bf4ca5b142211e704a8a834620d708f710a75bf4 /templates | |
parent | 15a1c2d7efa2c835fb9bcff439446579f08c5e32 (diff) |
add user visibility in dashboard navbar (#22747)
Add private/limited tag to dashboard user/org list dropdown menu
![image](https://user-images.githubusercontent.com/18380374/216752207-5beb5281-1b0b-4e2b-adfc-b39c192c5032.png)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/user/dashboard/navbar.tmpl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 719d5b06b..ab6f1bc58 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -5,12 +5,10 @@ <span class="text truncated-item-container"> {{avatar $.Context .ContextUser}} <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> - {{if .ContextUser.IsOrganization}} - <span class="org-visibility"> - {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} - {{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} - </span> - {{end}} + <span class="org-visibility"> + {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </span> <div class="context user overflow menu" tabindex="-1"> @@ -21,6 +19,10 @@ <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}"> {{avatar $.Context .SignedUser}} <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> + <span class="org-visibility"> + {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> </a> {{range .Orgs}} <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}"> |