diff options
author | EV3R4 <63237520+EV3R4@users.noreply.github.com> | 2021-01-22 00:44:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 00:44:37 +0100 |
commit | af7054511efdf1e0b36bd9e8c5744bce6ea1a5b9 (patch) | |
tree | da123f82df08eadfd94a366be42584014aa75d0d /routers | |
parent | aa4c33b43df44d68ab5072685329c472de290476 (diff) | |
download | gitea-af7054511efdf1e0b36bd9e8c5744bce6ea1a5b9.tar.gz gitea-af7054511efdf1e0b36bd9e8c5744bce6ea1a5b9.zip |
Add TrN for repository limit (#12492)
* Added TrN for repository limit
* Removed form.reach_limit_of_creation_0
* disable Create Button if user can not create
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/repo.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 2614389aaa..3832b89971 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -144,11 +144,10 @@ func Create(ctx *context.Context) { } } - if !ctx.User.CanCreateRepo() { - ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", ctx.User.MaxCreationLimit()), tplCreate, nil) - } else { - ctx.HTML(200, tplCreate) - } + ctx.Data["CanCreateRepo"] = ctx.User.CanCreateRepo() + ctx.Data["MaxCreationLimit"] = ctx.User.MaxCreationLimit() + + ctx.HTML(200, tplCreate) } func handleCreateError(ctx *context.Context, owner *models.User, err error, name string, tpl base.TplName, form interface{}) { |