diff --git a/pkg/view/auth.go b/pkg/view/auth.go
index 6b096d9ff553f6d8329eacf7265142696db11d4b..5d73b226372f028795f49131ca60be3cf10a8996 100644
--- a/pkg/view/auth.go
+++ b/pkg/view/auth.go
@@ -8,6 +8,7 @@
"git.sr.ht/~gabrielgio/img"
"git.sr.ht/~gabrielgio/img/pkg/ext"
"git.sr.ht/~gabrielgio/img/pkg/service"
+ "git.sr.ht/~gabrielgio/img/templates"
)
type AuthView struct {
@@ -21,7 +22,8 @@ }
}
func (v *AuthView) LoginView(ctx *fasthttp.RequestCtx) error {
- return img.Render[interface{}](ctx, "login.html", nil)
+ templates.WritePageTemplate(ctx, &templates.LoginPage{})
+ return nil
}
func (v *AuthView) Logout(ctx *fasthttp.RequestCtx) error {
diff --git a/templates/login.html b/templates/login.qtpl
rename from templates/login.html
rename to templates/login.qtpl
index 607faa101d1594e66bbf7c729880e4e42e80d25d..b8aa98c327c66c6d406ff87ecb76d615480e2fab 100644
--- a/templates/login.html
+++ b/templates/login.qtpl
@@ -1,6 +1,12 @@
-{{template "layout.html" .}}
-{{define "title"}} Login {{end}}
-{{define "content"}}
+{% code
+type LoginPage struct {}
+%}
+
+{% func (p *LoginPage) Title() %}
+Login
+{% endfunc %}
+
+{% func (p *LoginPage) Content() %}
<form action="/login" method="post">
<div class="field">
<label class="label">Username</label>
@@ -21,4 +27,7 @@ <div class="field">
<input class="button is-pulled-right" value="login" type="submit">
</div>
</form>
-{{end}}
+{% endfunc %}
+
+{% func (p *LoginPage) Script() %}
+{% endfunc %}