From c320f16a0b4bdc7b76594c515f7eb57a3becc565 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Tue, 11 Jun 2024 19:05:05 +0000 Subject: [PATCH] Fix wrong error highlighting on install page (#4063) More details are in PR message. Changes applied: * replace `Err_Services` with more specific `Err_DisabledRegistration` * highlight the self-registration option instead of services section Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4063 Reviewed-by: Earl Warren --- routers/install/install.go | 2 +- templates/install.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/install/install.go b/routers/install/install.go index dfd8047d04..140e008d9a 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -319,7 +319,7 @@ func SubmitInstall(ctx *context.Context) { // Check logic loophole between disable self-registration and no admin account. if form.DisableRegistration && len(form.AdminName) == 0 { - ctx.Data["Err_Services"] = true + ctx.Data["Err_DisabledRegistration"] = true ctx.Data["Err_Admin"] = true ctx.RenderWithErr(ctx.Tr("install.no_admin_and_disable_registration"), tplInstall, form) return diff --git a/templates/install.tmpl b/templates/install.tmpl index 400c565b34..356d75747e 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -154,7 +154,7 @@
- +
{{ctx.Locale.Tr "install.disable_registration.description"}} @@ -212,7 +212,7 @@
- + {{ctx.Locale.Tr "install.server_service_title"}}