From 8172210e4675b922b49bf1abfa50b5667f04a9f8 Mon Sep 17 00:00:00 2001 From: TheFox0x7 Date: Wed, 26 Mar 2025 17:27:21 +0100 Subject: [PATCH 1/5] fix user not being able to create repository in organization --- templates/repo/create.tmpl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index ad308c857cb12..09511ad0a5222 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -7,12 +7,6 @@
{{template "base/alert" .}} {{template "repo/create_helper" .}} - - {{if not .CanCreateRepo}} -
-

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

-
- {{end}}
{{.CsrfTokenHtml}}
@@ -212,7 +206,7 @@
-
From 48f61682b242aa7195251cfa0fb586908e3a82af Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 27 Mar 2025 10:22:46 +0800 Subject: [PATCH 2/5] show limit message --- routers/web/repo/repo.go | 4 ++-- templates/repo/create.tmpl | 16 +++++++++------- web_src/js/features/repo-new.ts | 22 ++++++++++++++++------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go index 73baf683ed577..54b7448a8986b 100644 --- a/routers/web/repo/repo.go +++ b/routers/web/repo/repo.go @@ -154,8 +154,8 @@ func createCommon(ctx *context.Context) { ctx.Data["Licenses"] = repo_module.Licenses ctx.Data["Readmes"] = repo_module.Readmes ctx.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate - ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo() - ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit() + ctx.Data["CanCreateRepoInDoer"] = ctx.Doer.CanCreateRepo() + ctx.Data["MaxCreationLimitOfDoer"] = ctx.Doer.MaxCreationLimit() ctx.Data["SupportedObjectFormats"] = git.DefaultFeatures().SupportedObjectFormats ctx.Data["DefaultObjectFormat"] = git.Sha1ObjectFormat } diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 09511ad0a5222..30401303e97ff 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -9,17 +9,19 @@ {{template "repo/create_helper" .}} {{.CsrfTokenHtml}} +
-