lens @ 1d9d5f40fe4092657f529bdba18f6f52511eea00

feat: Move login from `html/template` to qtpl
 1diff --git a/pkg/view/auth.go b/pkg/view/auth.go
 2index 6b096d9ff553f6d8329eacf7265142696db11d4b..5d73b226372f028795f49131ca60be3cf10a8996 100644
 3--- a/pkg/view/auth.go
 4+++ b/pkg/view/auth.go
 5@@ -8,6 +8,7 @@
 6 	"git.sr.ht/~gabrielgio/img"
 7 	"git.sr.ht/~gabrielgio/img/pkg/ext"
 8 	"git.sr.ht/~gabrielgio/img/pkg/service"
 9+	"git.sr.ht/~gabrielgio/img/templates"
10 )
11 
12 type AuthView struct {
13@@ -21,7 +22,8 @@ 	}
14 }
15 
16 func (v *AuthView) LoginView(ctx *fasthttp.RequestCtx) error {
17-	return img.Render[interface{}](ctx, "login.html", nil)
18+	templates.WritePageTemplate(ctx, &templates.LoginPage{})
19+	return nil
20 }
21 
22 func (v *AuthView) Logout(ctx *fasthttp.RequestCtx) error {
23diff --git a/templates/login.html b/templates/login.qtpl
24rename from templates/login.html
25rename to templates/login.qtpl
26index 607faa101d1594e66bbf7c729880e4e42e80d25d..b8aa98c327c66c6d406ff87ecb76d615480e2fab 100644
27--- a/templates/login.html
28+++ b/templates/login.qtpl
29@@ -1,6 +1,12 @@
30-{{template "layout.html" .}}
31-{{define "title"}} Login {{end}}
32-{{define "content"}}
33+{% code
34+type LoginPage struct {}
35+%}
36+
37+{% func (p *LoginPage) Title() %}
38+Login
39+{% endfunc %}
40+
41+{% func (p *LoginPage) Content() %}
42 <form action="/login" method="post">
43     <div class="field">
44         <label class="label">Username</label>
45@@ -21,4 +27,7 @@     <div class="field">
46         <input class="button is-pulled-right" value="login" type="submit">
47     </div>
48 </form>
49-{{end}}
50+{% endfunc %}
51+
52+{% func (p *LoginPage) Script() %}
53+{% endfunc %}