diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml index 630505b8b4..52080b092f 100644 --- a/models/fixtures/user.yml +++ b/models/fixtures/user.yml @@ -93,7 +93,7 @@ login_name: org3 type: 1 salt: ZogKvWdyEx - max_repo_creation: -1 + max_repo_creation: 1000 is_active: false is_admin: false is_restricted: false diff --git a/options/locale_next/locale_en-US.json b/options/locale_next/locale_en-US.json index ec5c313a90..195f58af80 100644 --- a/options/locale_next/locale_en-US.json +++ b/options/locale_next/locale_en-US.json @@ -46,6 +46,7 @@ "one": "wants to merge %[1]d commit from %[2]s into %[3]s", "other": "wants to merge %[1]d commits from %[2]s into %[3]s" }, + "repo.form.cannot_create": "All spaces in which you can create repositories have reached the limit of repositories.", "search.milestone_kind": "Search milestones…", "incorrect_root_url": "This Forgejo instance is configured to be served on \"%s\". You are currently viewing Forgejo through a different URL, which may cause parts of the application to break. The canonical URL is controlled by Forgejo admins via the ROOT_URL setting in the app.ini.", "themes.names.forgejo-auto": "Forgejo (follow system theme)", diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 7ee8587435..7c07f80c86 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -8,42 +8,48 @@ {{ctx.Locale.Tr "new_repo.title"}}
- {{template "base/alert" .}} - {{template "repo/create_helper" .}} + {{if or .CanCreateRepo .Orgs}} + {{template "base/alert" .}} + {{template "repo/create_helper" .}} - {{if not .CanCreateRepo}} + {{if and (not .CanCreateRepo) (ne .MaxCreationLimit 0)}} +
+

{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}

+
+ {{end}} +
+ {{template "repo/create_basic" .}} +
+ +
+ + {{ctx.Locale.Tr "repo.new_from_template"}} + {{ctx.Locale.Tr "repo.new_from_template_description"}} + + {{template "repo/create_from_template" .}} +
+ +
+
+ {{ctx.Locale.Tr "repo.auto_init"}} + {{template "repo/create_init" .}} +
+ +
+ {{ctx.Locale.Tr "repo.new_advanced"}} +
{{ctx.Locale.Tr "repo.new_advanced_expand"}} + {{template "repo/create_advanced" .}} +
+
+
+ + {{else}}
-

{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}

+ {{ctx.Locale.Tr "repo.form.cannot_create"}}
{{end}} -
- {{template "repo/create_basic" .}} -
- -
- - {{ctx.Locale.Tr "repo.new_from_template"}} - {{ctx.Locale.Tr "repo.new_from_template_description"}} - - {{template "repo/create_from_template" .}} -
- -
-
- {{ctx.Locale.Tr "repo.auto_init"}} - {{template "repo/create_init" .}} -
- -
- {{ctx.Locale.Tr "repo.new_advanced"}} -
{{ctx.Locale.Tr "repo.new_advanced_expand"}} - {{template "repo/create_advanced" .}} -
-
-
-
diff --git a/templates/repo/create_basic.tmpl b/templates/repo/create_basic.tmpl index 0396629fef..90545c2769 100644 --- a/templates/repo/create_basic.tmpl +++ b/templates/repo/create_basic.tmpl @@ -2,17 +2,27 @@ {{ctx.Locale.Tr "repo.owner"}}