From 97b70a0cd40e8f73cdf6ba4397087b45061de3d8 Mon Sep 17 00:00:00 2001 From: Hester Gong Date: Sun, 7 May 2023 08:33:43 +0800 Subject: [PATCH] Add org visibility label to non-organization's dashboard (#24558) --- templates/user/dashboard/repolist.tmpl | 5 ++++- web_src/js/components/DashboardRepoList.vue | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index 5d78970a5..44542d579 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -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}}; diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index 33b312aa6..5cedbcb00 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -131,6 +131,9 @@
{{ org.name }} + + {{ org.org_visibility === 'limited' ? textOrgVisibilityLimited: textOrgVisibilityPrivate }} +
{{ org.num_repos }}