Hide "Create Repo" option if limit is reached

This commit is contained in:
Sebastian Luino 2024-08-10 19:58:06 -04:00
parent 8369e10b8f
commit 300dfae3e5
1 changed files with 10 additions and 8 deletions

View File

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