From 1e45ae2ea3497958b2ea6a20137955cfc3bbc964 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 11 Dec 2024 17:05:12 +0100 Subject: feat: Add UI/Handler login process It adds the whole workflow to store and handle login on both UI and handler level. With that the login information should be available at any point given the context. --- templates/login.qtpl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'templates/login.qtpl') diff --git a/templates/login.qtpl b/templates/login.qtpl index eee5711..7815bd7 100644 --- a/templates/login.qtpl +++ b/templates/login.qtpl @@ -1,31 +1,41 @@ +{% import "context" %} + {% code type LoginPage struct { + ErrorMessage string } %} -{% func (p *LoginPage) Title() %}Hello{% endfunc %} +{% func (p *LoginPage) Title(ctx context.Context) %}Hello{% endfunc %} -{% func (p *LoginPage) Navbar() %}{%= Navbar(Login) %}{% endfunc %} +{% func (p *LoginPage) Navbar(ctx context.Context) %}{%= Navbar(ctx, Login) %}{% endfunc %} -{% func (p *LoginPage) Content() %} +{% func (p *LoginPage) Content(ctx context.Context) %}
-
+
- +
- +
+ {% if p.ErrorMessage != "" %} +
+
+ {%s p.ErrorMessage %} +
+
+ {% endif %}
{% endfunc %} -{% func (p *LoginPage) Script() %} +{% func (p *LoginPage) Script(ctx context.Context) %} {% endfunc %} -- cgit v1.2.3