diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-25 22:35:47 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-25 22:35:47 +0200 |
commit | 869f50db2fbc24826762fb61d35e5f8de79296c1 (patch) | |
tree | 10bd08d7d4b34b61f74e5758e9157c2e10e069fc /templates | |
parent | c9e5d242cbba5e3b9d3ddc4465a9a1367e44cd16 (diff) | |
download | lens-869f50db2fbc24826762fb61d35e5f8de79296c1.tar.gz lens-869f50db2fbc24826762fb61d35e5f8de79296c1.tar.bz2 lens-869f50db2fbc24826762fb61d35e5f8de79296c1.zip |
feat: Handle login error
Diffstat (limited to 'templates')
-rw-r--r-- | templates/login.qtpl | 18 | ||||
-rw-r--r-- | templates/register.qtpl | 4 |
2 files changed, 17 insertions, 5 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 %} diff --git a/templates/register.qtpl b/templates/register.qtpl index 115edfe..4d3c545 100644 --- a/templates/register.qtpl +++ b/templates/register.qtpl @@ -25,8 +25,8 @@ type RegisterPage struct {} <input class="input" name="path" type="text"> </div> </div> - <div class="field"> - <input class="button is-pulled-right" value="Save" type="submit"> + <div class="field is-grouped is-grouped-right"> + <input class="button" value="Save" type="submit"> </div> </form> {% endfunc %} |