aboutsummaryrefslogtreecommitdiff
path: root/templates/login.qtpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/login.qtpl')
-rw-r--r--templates/login.qtpl24
1 files changed, 17 insertions, 7 deletions
diff --git a/templates/login.qtpl b/templates/login.qtpl
index eee5711..7815bd7 100644
--- a/templates/login.qtpl
+++ b/templates/login.qtpl
@@ -1,31 +1,41 @@
+{% import "context" %}
+
{% code
type LoginPage struct {
+ ErrorMessage string
}
%}
-{% func (p *LoginPage) Title() %}Hello{% endfunc %}
+{% func (p *LoginPage) Title(ctx context.Context) %}Hello{% endfunc %}
-{% func (p *LoginPage) Navbar() %}{%= Navbar(Login) %}{% endfunc %}
+{% func (p *LoginPage) Navbar(ctx context.Context) %}{%= Navbar(ctx, Login) %}{% endfunc %}
-{% func (p *LoginPage) Content() %}
+{% func (p *LoginPage) Content(ctx context.Context) %}
<div class="row">
<div class="col-md-6 offset-md-3">
- <form>
+ <form action="/login/" method="POST">
<div class="form-group m-3">
<label for="username" class="form-label">Username</label>
- <input type="text" class="form-control" id="username" aria-describedby="emailHelp">
+ <input type="text" class="form-control" name="username" id="username">
</div>
<div class="form-group m-3">
<label for="password" class="form-label">Password</label>
- <input type="password" class="form-control" id="password">
+ <input type="password" class="form-control" name="password" id="password">
</div>
<div class="form-group m-3">
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
</div>
+ {% if p.ErrorMessage != "" %}
+ <div class="col-md-6 offset-md-3">
+ <div class="alert alert-warning text-center" >
+ {%s p.ErrorMessage %}
+ </div>
+ </div>
+ {% endif %}
</div>
{% endfunc %}
-{% func (p *LoginPage) Script() %}
+{% func (p *LoginPage) Script(ctx context.Context) %}
{% endfunc %}