diff options
author | Spencer Taylor <smtaylorslc@gmail.com> | 2020-10-06 01:25:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 02:25:43 -0400 |
commit | 6eea301829eaddba8f64a821374996b2b41317fc (patch) | |
tree | 492858c49a365a0f41b9a7a49fb9f9b0d1a42c0a | |
parent | df4bbcd235cec8708cd0cbdd9bcbdd00f5db4fd5 (diff) | |
download | gitea-6eea301829eaddba8f64a821374996b2b41317fc.tar.gz gitea-6eea301829eaddba8f64a821374996b2b41317fc.zip |
Adding visual cue for "Limited" & "Private" organizations. (#13040)
* Adding visual cue for "Limited" & "Private" organizations.
* Moving org visibility CSS styles to .less files.
Co-authored-by: Gitea <gitea@fake.local>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r-- | options/locale/locale_en-US.ini | 2 | ||||
-rw-r--r-- | templates/org/header.tmpl | 5 | ||||
-rw-r--r-- | templates/org/home.tmpl | 4 | ||||
-rw-r--r-- | templates/user/dashboard/navbar.tmpl | 10 | ||||
-rw-r--r-- | web_src/less/_dashboard.less | 3 | ||||
-rw-r--r-- | web_src/less/_organization.less | 9 |
6 files changed, 31 insertions, 2 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 7bb62250a4..2c6de37e60 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1869,7 +1869,9 @@ settings.repoadminchangeteam = Repository admin can add and remove access for te settings.visibility = Visibility settings.visibility.public = Public settings.visibility.limited = Limited (Visible to logged in users only) +settings.visibility.limited_shortname = Limited settings.visibility.private = Private (Visible only to organization members) +settings.visibility.private_shortname = Private settings.update_settings = Update Settings settings.update_setting_success = Organization settings have been updated. diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 17cc58fcbb..e232726822 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -5,7 +5,10 @@ <div class="ui header"> <img class="ui image" src="{{.SizedRelAvatarLink 100}}"> <span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span> - + <span class="org-visibility"> + {{if .Visibility.IsLimited}}<div class="ui medium orange horizontal label">{{$.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .Visibility.IsPrivate}}<div class="ui medium red horizontal label">{{$.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> <div class="ui right"> <div class="ui menu"> <a class="{{if $.PageIsOrgMembers}}active{{end}} item" href="{{$.OrgLink}}/members"> diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 01c1fe66b0..024be119bd 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -7,6 +7,10 @@ <div id="org-info"> <div class="ui header"> {{.Org.DisplayName}} + <span class="org-visibility"> + {{if .Org.Visibility.IsLimited}}<div class="ui large orange horizontal label">{{.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .Org.Visibility.IsPrivate}}<div class="ui large red horizontal label">{{.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> {{if .IsOrganizationOwner}}<a class="middle text grey" href="{{.OrgLink}}/settings">{{svg "octicon-gear"}}</a>{{end}} </div> {{if .Org.Description}}<p class="desc">{{.Org.Description}}</p>{{end}} diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index c94dfa5e8f..a911d1c4e1 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -5,6 +5,12 @@ <span class="text"> <img class="ui avatar image" src="{{.ContextUser.RelAvatarLink}}" title="{{.ContextUser.Name}}" width="28" height="28"> {{.ContextUser.ShortName 20}} + {{if .ContextUser.IsOrganization}} + <span class="org-visibility"> + {{if .ContextUser.Visibility.IsLimited}}<div class="ui orange tiny horizontal label">{{.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .ContextUser.Visibility.IsPrivate}}<div class="ui red tiny horizontal label">{{.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> + {{end}} <i class="dropdown icon"></i> </span> <div class="context user overflow menu" tabindex="-1"> @@ -20,6 +26,10 @@ <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" title="{{.Name}}" href="{{AppSubUrl}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}"> <img class="ui avatar image" src="{{.RelAvatarLink}}" width="28" height="28"> {{.ShortName 20}} + <span class="org-visibility"> + {{if .Visibility.IsLimited}}<div class="ui orange tiny horizontal label">{{$.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} + {{if .Visibility.IsPrivate}}<div class="ui red tiny horizontal label">{{$.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}} + </span> </a> {{end}} </div> diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index 318e9934a3..3ccbff5c9b 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -74,6 +74,9 @@ .dashboard-navbar { width: 100vw; padding: 0 .5rem; + .org-visibility .label { + margin-left: 5px; + } } } diff --git a/web_src/less/_organization.less b/web_src/less/_organization.less index 1010b7a911..11b53a4cf1 100644 --- a/web_src/less/_organization.less +++ b/web_src/less/_organization.less @@ -8,7 +8,10 @@ font-size: 1.6rem; margin-left: 15px; } - + .org-visibility .label { + margin-left: 5px; + margin-top: 5px; + } .ui.right { margin-top: 5px; } @@ -43,6 +46,10 @@ .ui.header { font-size: 36px; margin-bottom: 0; + .org-visibility .label { + margin-left: 5px; + margin-top: 2px; + } } .desc { |