blob: c68fb5f8dd68488cbf0e1e5b2bc150c5fcfe806a (
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
|
{% code
type LoginPage struct {
Username string
Err string
}
%}
{% func (p *LoginPage) Title() %}Login{% endfunc %}
{% func (p *LoginPage) Content() %}
<form action="/login" method="post">
<div class="field">
<label class="label">Username</label>
<div class="control">
<input class="input" name="username" value="{%s p.Username %}" type="text">
</div>
</div>
<div class="field">
<label class="label">Password</label>
<div class="control">
<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">
<article class="message is-danger">
<div class="message-body">
{%s p.Err %}
</div>
</article>
</div>
{% endif %}
</form>
{% endfunc %}
{% func (p *LoginPage) Script() %}
{% endfunc %}
|