mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -1869,7 +1869,9 @@ settings.repoadminchangeteam = Repository admin can add and remove access for te
 | 
				
			|||||||
settings.visibility = Visibility
 | 
					settings.visibility = Visibility
 | 
				
			||||||
settings.visibility.public = Public
 | 
					settings.visibility.public = Public
 | 
				
			||||||
settings.visibility.limited = Limited (Visible to logged in users only)
 | 
					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 = Private (Visible only to organization members)
 | 
				
			||||||
 | 
					settings.visibility.private_shortname = Private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
settings.update_settings = Update Settings
 | 
					settings.update_settings = Update Settings
 | 
				
			||||||
settings.update_setting_success = Organization settings have been updated.
 | 
					settings.update_setting_success = Organization settings have been updated.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,10 @@
 | 
				
			|||||||
				<div class="ui header">
 | 
									<div class="ui header">
 | 
				
			||||||
					<img class="ui image" src="{{.SizedRelAvatarLink 100}}">
 | 
										<img class="ui image" src="{{.SizedRelAvatarLink 100}}">
 | 
				
			||||||
					<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
 | 
										<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 right">
 | 
				
			||||||
						<div class="ui menu">
 | 
											<div class="ui menu">
 | 
				
			||||||
							<a class="{{if $.PageIsOrgMembers}}active{{end}} item" href="{{$.OrgLink}}/members">
 | 
												<a class="{{if $.PageIsOrgMembers}}active{{end}} item" href="{{$.OrgLink}}/members">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,10 @@
 | 
				
			|||||||
		<div id="org-info">
 | 
							<div id="org-info">
 | 
				
			||||||
			<div class="ui header">
 | 
								<div class="ui header">
 | 
				
			||||||
				{{.Org.DisplayName}}
 | 
									{{.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}}
 | 
									{{if .IsOrganizationOwner}}<a class="middle text grey" href="{{.OrgLink}}/settings">{{svg "octicon-gear"}}</a>{{end}}
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			{{if .Org.Description}}<p class="desc">{{.Org.Description}}</p>{{end}}
 | 
								{{if .Org.Description}}<p class="desc">{{.Org.Description}}</p>{{end}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,12 @@
 | 
				
			|||||||
				<span class="text">
 | 
									<span class="text">
 | 
				
			||||||
					<img class="ui avatar image" src="{{.ContextUser.RelAvatarLink}}" title="{{.ContextUser.Name}}" width="28" height="28">
 | 
										<img class="ui avatar image" src="{{.ContextUser.RelAvatarLink}}" title="{{.ContextUser.Name}}" width="28" height="28">
 | 
				
			||||||
					{{.ContextUser.ShortName 20}}
 | 
										{{.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>
 | 
										<i class="dropdown icon"></i>
 | 
				
			||||||
				</span>
 | 
									</span>
 | 
				
			||||||
				<div class="context user overflow menu" tabindex="-1">
 | 
									<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}}">
 | 
												<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">
 | 
													<img class="ui avatar image" src="{{.RelAvatarLink}}" width="28" height="28">
 | 
				
			||||||
								{{.ShortName 20}}
 | 
													{{.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>
 | 
												</a>
 | 
				
			||||||
						{{end}}
 | 
											{{end}}
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -74,6 +74,9 @@
 | 
				
			|||||||
  .dashboard-navbar {
 | 
					  .dashboard-navbar {
 | 
				
			||||||
    width: 100vw;
 | 
					    width: 100vw;
 | 
				
			||||||
    padding: 0 .5rem;
 | 
					    padding: 0 .5rem;
 | 
				
			||||||
 | 
					    .org-visibility .label {
 | 
				
			||||||
 | 
					      margin-left: 5px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,10 @@
 | 
				
			|||||||
        font-size: 1.6rem;
 | 
					        font-size: 1.6rem;
 | 
				
			||||||
        margin-left: 15px;
 | 
					        margin-left: 15px;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      .org-visibility .label {
 | 
				
			||||||
 | 
					        margin-left: 5px;
 | 
				
			||||||
 | 
					        margin-top: 5px;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      .ui.right {
 | 
					      .ui.right {
 | 
				
			||||||
        margin-top: 5px;
 | 
					        margin-top: 5px;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -43,6 +46,10 @@
 | 
				
			|||||||
      .ui.header {
 | 
					      .ui.header {
 | 
				
			||||||
        font-size: 36px;
 | 
					        font-size: 36px;
 | 
				
			||||||
        margin-bottom: 0;
 | 
					        margin-bottom: 0;
 | 
				
			||||||
 | 
					        .org-visibility .label {
 | 
				
			||||||
 | 
					          margin-left: 5px;
 | 
				
			||||||
 | 
					          margin-top: 2px;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      .desc {
 | 
					      .desc {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user