aboutsummaryrefslogtreecommitdiff
path: root/templates/login.qtpl
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-08-25 22:35:47 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-08-25 22:35:47 +0200
commit869f50db2fbc24826762fb61d35e5f8de79296c1 (patch)
tree10bd08d7d4b34b61f74e5758e9157c2e10e069fc /templates/login.qtpl
parentc9e5d242cbba5e3b9d3ddc4465a9a1367e44cd16 (diff)
downloadlens-869f50db2fbc24826762fb61d35e5f8de79296c1.tar.gz
lens-869f50db2fbc24826762fb61d35e5f8de79296c1.tar.bz2
lens-869f50db2fbc24826762fb61d35e5f8de79296c1.zip
feat: Handle login error
Diffstat (limited to 'templates/login.qtpl')
-rw-r--r--templates/login.qtpl18
1 files changed, 15 insertions, 3 deletions
diff --git a/templates/login.qtpl b/templates/login.qtpl
index 56394d0..c68fb5f 100644
--- a/templates/login.qtpl
+++ b/templates/login.qtpl
@@ -1,5 +1,8 @@
{% code
-type LoginPage struct {}
+type LoginPage struct {
+ Username string
+ Err string
+ }
%}
{% func (p *LoginPage) Title() %}Login{% endfunc %}
@@ -9,7 +12,7 @@ type LoginPage struct {}
<div class="field">
<label class="label">Username</label>
<div class="control">
- <input class="input" name="username" type="text">
+ <input class="input" name="username" value="{%s p.Username %}" type="text">
</div>
</div>
<div class="field">
@@ -18,9 +21,18 @@ type LoginPage struct {}
<input class="input" name="password" type="password">
</div>
</div>
+ <div class="field is-grouped is-grouped-right">
+ <input class="button" value="login" type="submit">
+ </div>
+ {% if p.Err != "" %}
<div class="field">
- <input class="button is-pulled-right" value="login" type="submit">
+ <article class="message is-danger">
+ <div class="message-body">
+ {%s p.Err %}
+ </div>
+ </article>
</div>
+ {% endif %}
</form>
{% endfunc %}