Fix other create buttons

This commit is contained in:
Sebastian Luino 2024-08-12 22:17:04 -04:00
parent 300dfae3e5
commit dbc780b7f6
3 changed files with 12 additions and 2 deletions

View File

@ -15,7 +15,7 @@
{{if .ShowMemberAndTeamTab}} {{if .ShowMemberAndTeamTab}}
<div class="ui five wide column"> <div class="ui five wide column">
{{if .CanCreateOrgRepo}} {{if and .CanCreateOrgRepo .SignedUser.CanCreateRepo}}
<div class="center aligned tw-mb-4"> <div class="center aligned tw-mb-4">
<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a> <a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
{{if not .DisableNewPullMirrors}} {{if not .DisableNewPullMirrors}}

View File

@ -13,6 +13,7 @@ const data = {
textFilter: {{ctx.Locale.Tr "home.filter"}}, textFilter: {{ctx.Locale.Tr "home.filter"}},
textShowArchived: {{ctx.Locale.Tr "home.show_archived"}}, textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
textShowPrivate: {{ctx.Locale.Tr "home.show_private"}}, 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"}}, textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}},
textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_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.isOrganization = false;
data.organizationsTotalCount = {{.UserOrgsCount}}; data.organizationsTotalCount = {{.UserOrgsCount}};
data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}}; data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};
data.canCreateRepo = {{.SignedUser.CanCreateRepo}};
{{else}} {{else}}
data.organizationId = {{.ContextUser.ID}}; data.organizationId = {{.ContextUser.ID}};
{{end}} {{end}}

View File

@ -350,9 +350,12 @@ export default sfc; // activate the IDE's Vue plugin
{{ textMyRepos }} {{ textMyRepos }}
<span class="ui grey label tw-ml-2">{{ reposTotalCount }}</span> <span class="ui grey label tw-ml-2">{{ reposTotalCount }}</span>
</div> </div>
<a class="tw-flex tw-items-center muted" :href="subUrl + '/repo/create' + (isOrganization ? '?org=' + organizationId : '')" :data-tooltip-content="textNewRepo"> <a v-if="canCreateRepo" class="tw-flex tw-items-center muted" :href="subUrl + '/repo/create' + (isOrganization ? '?org=' + organizationId : '')" :data-tooltip-content="textNewRepo">
<svg-icon name="octicon-plus"/> <svg-icon name="octicon-plus"/>
</a> </a>
<span v-else class="tw-flex tw-items-center disabled" :data-tooltip-content="textRepoReachLimitOfCreation">
<svg-icon name="octicon-plus"/>
</span>
</h4> </h4>
<div class="ui attached segment repos-search"> <div class="ui attached segment repos-search">
<div class="ui small fluid action left icon input"> <div class="ui small fluid action left icon input">
@ -546,4 +549,9 @@ ul li:not(:last-child) {
.repo-owner-name-list li.active { .repo-owner-name-list li.active {
background: var(--color-hover); background: var(--color-hover);
} }
span.disabled {
opacity: var(--opacity-disabled);
}
</style> </style>