diff --git a/pkg/view/auth.go b/pkg/view/auth.go
index 5d73b226372f028795f49131ca60be3cf10a8996..631cfb30815cde5ec8694a09073da6a597b8e0a4 100644
--- a/pkg/view/auth.go
+++ b/pkg/view/auth.go
@@ -5,7 +5,6 @@ "encoding/base64"
"github.com/valyala/fasthttp"
- "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"
@@ -71,7 +70,8 @@ ctx.Redirect("/login", 307)
}
func (v *AuthView) InitialRegisterView(ctx *fasthttp.RequestCtx) error {
- return img.Render[interface{}](ctx, "register.html", nil)
+ templates.WritePageTemplate(ctx, &templates.RegisterPage{})
+ return nil
}
func (v *AuthView) InitialRegister(ctx *fasthttp.RequestCtx) error {
diff --git a/templates/error.qtpl b/templates/error.qtpl
index b71adc8794e3bfc0f43978ccb594900210cc38af..d82ca1c98904e31f12e80771a9c44664a105dc41 100644
--- a/templates/error.qtpl
+++ b/templates/error.qtpl
@@ -4,9 +4,7 @@ Err string
}
%}
-{% func (p *ErrorPage) Title() %}
-Error
-{% endfunc %}
+{% func (p *ErrorPage) Title() %}Error{% endfunc %}
{% func (p *ErrorPage) Content() %}
{%s p.Err %}
diff --git a/templates/login.qtpl b/templates/login.qtpl
index b8aa98c327c66c6d406ff87ecb76d615480e2fab..d0490f94ddc82b479fa317fd6bdb3b5ce859bb79 100644
--- a/templates/login.qtpl
+++ b/templates/login.qtpl
@@ -2,9 +2,7 @@ {% code
type LoginPage struct {}
%}
-{% func (p *LoginPage) Title() %}
-Login
-{% endfunc %}
+{% func (p *LoginPage) Title() %}Login{% endfunc %}
{% func (p *LoginPage) Content() %}
<form action="/login" method="post">
diff --git a/templates/media.qtpl b/templates/media.qtpl
index b9b3bf55abe33232484b8d4d7f4b200cf75d3699..65b39c426344118fbbe8e1336ddb02c5e36e8e77 100644
--- a/templates/media.qtpl
+++ b/templates/media.qtpl
@@ -7,9 +7,7 @@ Next *repository.Pagination
}
%}
-{% func (p *MediaPage) Title() %}
-Media
-{% endfunc %}
+{% func (p *MediaPage) Title() %}Media{% endfunc %}
{% func (p *MediaPage) Content() %}
<div class="columns is-multiline">
diff --git a/templates/register.qtpl b/templates/register.qtpl
new file mode 100644
index 0000000000000000000000000000000000000000..115edfeab3e33fe1f11b2dbf6afc9f3587e40a88
--- /dev/null
+++ b/templates/register.qtpl
@@ -0,0 +1,35 @@
+{% code
+type RegisterPage struct {}
+%}
+
+{% func (p *RegisterPage) Title() %}Login{% endfunc %}
+
+{% func (p *RegisterPage) Content() %}
+<h1>Initial Setup</h1>
+<form action="/initial" method="post">
+ <div class="field">
+ <label class="label">Username</label>
+ <div class="control">
+ <input class="input" name="username" type="text">
+ </div>
+ </div>
+ <div class="field">
+ <label class="label">Password</label>
+ <div class="control">
+ <input class="input" name="password" type="password">
+ </div>
+ </div>
+ <div class="field">
+ <label class="label">Root folder</label>
+ <div class="control">
+ <input class="input" name="path" type="text">
+ </div>
+ </div>
+ <div class="field">
+ <input class="button is-pulled-right" value="Save" type="submit">
+ </div>
+</form>
+{% endfunc %}
+
+{% func (p *RegisterPage) Script() %}
+{% endfunc %}