Add org visibility label to non-organization's dashboard (#24558)

pull/24565/head^2
Hester Gong 2 years ago committed by GitHub
parent 4daf40505a
commit 97b70a0cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      templates/user/dashboard/repolist.tmpl
  2. 3
      web_src/js/components/DashboardRepoList.vue

@ -35,6 +35,9 @@ const data = {
textMyOrgs: {{.locale.Tr "home.my_orgs"}},
textNewOrg: {{.locale.Tr "new_org"}},
textOrgVisibilityLimited: {{.locale.Tr "org.settings.visibility.limited_shortname"}},
textOrgVisibilityPrivate: {{.locale.Tr "org.settings.visibility.private_shortname"}},
};
{{if .Team}}
@ -42,7 +45,7 @@ data.teamId = {{.Team.ID}};
{{end}}
{{if not .ContextUser.IsOrganization}}
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}},{{end}}];
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
data.isOrganization = false;
data.organizationsTotalCount = {{.UserOrgsCount}};
data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};

@ -131,6 +131,9 @@
<div class="text truncate item-name gt-f1">
<svg-icon name="octicon-organization" :size="16" class-name="gt-mr-2"/>
<strong>{{ org.name }}</strong>
<span class="ui tiny basic label gt-ml-3" v-if="org.org_visibility !== 'public'">
{{ org.org_visibility === 'limited' ? textOrgVisibilityLimited: textOrgVisibilityPrivate }}
</span>
</div>
<div class="text light grey gt-df gt-ac">
{{ org.num_repos }}

Loading…
Cancel
Save