From 4eedfdcf6f57d3b781a806a365673a9989b6d5c7 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:09:08 +0200 Subject: [PATCH] Fix login page disabled depending on locale (#120) --- internal/web/auth.go | 2 ++ templates/pages/auth_form.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/web/auth.go b/internal/web/auth.go index 2457f22..c18fe24 100644 --- a/internal/web/auth.go +++ b/internal/web/auth.go @@ -31,6 +31,7 @@ func register(ctx echo.Context) error { setData(ctx, "title", tr(ctx, "auth.new-account")) setData(ctx, "htmlTitle", "New account") setData(ctx, "disableForm", getData(ctx, "DisableLoginForm")) + setData(ctx, "isLoginPage", false) return html(ctx, "auth_form.html") } @@ -91,6 +92,7 @@ func login(ctx echo.Context) error { setData(ctx, "title", tr(ctx, "auth.login")) setData(ctx, "htmlTitle", "Login") setData(ctx, "disableForm", getData(ctx, "DisableLoginForm")) + setData(ctx, "isLoginPage", true) return html(ctx, "auth_form.html") } diff --git a/templates/pages/auth_form.html b/templates/pages/auth_form.html index 64179f5..63695ca 100644 --- a/templates/pages/auth_form.html +++ b/templates/pages/auth_form.html @@ -8,7 +8,7 @@
- {{ if and .DisableSignup (ne .title "Login") }} + {{ if and .DisableSignup (not .isLoginPage) }}

{{ .locale.Tr "auth.signup-disabled" }}

{{ else }}
@@ -30,7 +30,7 @@
- {{ if eq .title "Login" }} + {{ if .isLoginPage }}