aboutsummaryrefslogtreecommitdiff
path: root/templates/login.qtpl
blob: 7815bd7401ff8cdee199144ac88b61421f253eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{% import "context" %}

{% code
type LoginPage struct {
    ErrorMessage string
}
%}

{% func (p *LoginPage) Title(ctx context.Context) %}Hello{% endfunc %}

{% func (p *LoginPage) Navbar(ctx context.Context) %}{%= Navbar(ctx, Login) %}{% endfunc %}

{% func (p *LoginPage) Content(ctx context.Context) %}
<div class="row">
  <div class="col-md-6 offset-md-3">
    <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" 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" 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(ctx context.Context) %}
{% endfunc %}