From dbc780b7f665b7d5934773c053906fcc523e00ff Mon Sep 17 00:00:00 2001 From: Sebastian Luino Date: Mon, 12 Aug 2024 22:17:04 -0400 Subject: [PATCH] Fix other create buttons --- templates/org/home.tmpl | 2 +- templates/user/dashboard/repolist.tmpl | 2 ++ web_src/js/components/DashboardRepoList.vue | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 4851b699796..7fc45ade98e 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -15,7 +15,7 @@ {{if .ShowMemberAndTeamTab}}
- {{if .CanCreateOrgRepo}} + {{if and .CanCreateOrgRepo .SignedUser.CanCreateRepo}}
{{ctx.Locale.Tr "new_repo"}} {{if not .DisableNewPullMirrors}} diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index be710675d56..59362a99241 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -13,6 +13,7 @@ const data = { textFilter: {{ctx.Locale.Tr "home.filter"}}, textShowArchived: {{ctx.Locale.Tr "home.show_archived"}}, textShowPrivate: {{ctx.Locale.Tr "home.show_private"}}, + textRepoReachLimitOfCreation: {{ctx.Locale.TrN .SignedUser.MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .SignedUser.MaxCreationLimit}}, textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}}, textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_unarchived"}}, @@ -49,6 +50,7 @@ data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepo data.isOrganization = false; data.organizationsTotalCount = {{.UserOrgsCount}}; data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}}; +data.canCreateRepo = {{.SignedUser.CanCreateRepo}}; {{else}} data.organizationId = {{.ContextUser.ID}}; {{end}} diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index afc58d36892..94c12489671 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -350,9 +350,12 @@ export default sfc; // activate the IDE's Vue plugin {{ textMyRepos }} {{ reposTotalCount }}
- + + + +