This commit is contained in:
Sebastian Luino 2024-10-17 08:06:47 +02:00 committed by GitHub
commit 50d5ba34e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 33 additions and 6 deletions

View File

@ -105,9 +105,20 @@
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{if .SignedUser.CanCreateRepo}}
<a class="item" href="{{AppSubUrl}}/repo/create">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{else}}
<a
class="disabled-with-tooltip item"
data-tooltip-content="{{ctx.Locale.TrN .SignedUser.MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .SignedUser.MaxCreationLimit}}"
href="/"
onclick="event.stopPropagation(); event.preventDefault()"
>
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{end}}
{{if not .DisableMigrations}}
<a class="item" href="{{AppSubUrl}}/repo/migrate">
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}

View File

@ -15,7 +15,7 @@
{{if .ShowMemberAndTeamTab}}
<div class="ui five wide column">
{{if .CanCreateOrgRepo}}
{{if and .CanCreateOrgRepo .SignedUser.CanCreateRepo}}
<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>
{{if not .DisableNewPullMirrors}}

View File

@ -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}}

View File

@ -1397,6 +1397,12 @@ table th[data-sortt-desc] .svg {
min-width: 0;
}
.ui.dropdown .menu > .disabled-with-tooltip.item {
cursor: default;
opacity: var(--opacity-disabled);
background: inherit;
}
.ui.dropdown.ellipsis-items-nowrap > .text {
overflow: hidden;
white-space: nowrap;

View File

@ -51,7 +51,7 @@
justify-content: stretch;
}
#navbar a.item:hover,
#navbar a.item:hover:not(.disabled-with-tooltip),
#navbar button.item:hover {
background: var(--color-nav-hover-bg);
}

View File

@ -349,9 +349,12 @@ export default sfc; // activate the IDE's Vue plugin
{{ textMyRepos }}
<span class="ui grey label tw-ml-2">{{ reposTotalCount }}</span>
</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"/>
</a>
<span v-else class="tw-flex tw-items-center disabled" :data-tooltip-content="textRepoReachLimitOfCreation">
<svg-icon name="octicon-plus"/>
</span>
</h4>
<div class="ui attached segment repos-search">
<div class="ui small fluid action left icon input">
@ -545,4 +548,9 @@ ul li:not(:last-child) {
.repo-owner-name-list li.active {
background: var(--color-hover);
}
span.disabled {
opacity: var(--opacity-disabled);
}
</style>