cerrado @ c51e2ae8af53a544cb6aa0bdc4713cb9571ba304

 1{% import "context" %}
 2
 3{% code
 4type LoginPage struct {
 5    Referer string
 6    ErrorMessage string
 7}
 8%}
 9
10{% func (p *LoginPage) Title(ctx context.Context) %}Hello{% endfunc %}
11
12{% func (p *LoginPage) Navbar(ctx context.Context) %}{%= Navbar(ctx, Login) %}{% endfunc %}
13
14{% func (p *LoginPage) Content(ctx context.Context) %}
15<div class="row">
16  <div class="col-md-6 offset-md-3">
17  {% if p.Referer == "" %}
18    <form action="/login/" method="POST">
19  {% else %}
20    <form action="/login/?referer={%s p.Referer %}" method="POST">
21  {% endif %}
22      <div class="form-group m-3">
23        <label for="username" class="form-label">Username</label>
24        <input type="text" class="form-control" name="username" id="username">
25      </div>
26      <div class="form-group m-3">
27        <label for="password" class="form-label">Password</label>
28        <input type="password" class="form-control" name="password" id="password">
29      </div>
30      <div class="form-group m-3">
31        <button type="submit" class="btn btn-primary">Login</button>
32      </div>
33    </form>
34  </div>
35  {% if p.ErrorMessage != "" %}
36  <div class="col-md-6 offset-md-3">
37    <div class="alert alert-warning text-center" >
38        {%s p.ErrorMessage  %}
39    </div>
40  </div>
41  {% endif %}
42</div>
43{% endfunc %}
44
45{% func (p *LoginPage) Script(ctx context.Context) %}
46{% endfunc %}