Hide "Create Repo" option if limit is reached

This commit is contained in:
Sebastian Luino 2024-08-10 19:58:06 -04:00
parent df27846628
commit 9d3a2feeba
3 changed files with 17 additions and 2 deletions

View File

@ -105,7 +105,16 @@
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
</span>
<div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create">
<a
{{if not .SignedUser.CanCreateRepo}}
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()"
{{else}}
class="item" href="{{AppSubUrl}}/repo/create"
{{end}}
>
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
</a>
{{if not .DisableMigrations}}

View File

@ -1393,6 +1393,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);
}