blob: 6ec783d6d9bbc32dcb34efe3deba29230cdc3e39 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
|
{% code
type UserPage struct {
ID *uint
Username string
Path string
IsAdmin bool
}
%}
{% func (p *UserPage) Title() %}User{% endfunc %}
{% func (p *UserPage) Content() %}
<h1>Initial Setup</h1>
<form action="/users/" method="post">
{% if p.ID != nil %}
<input type="hidden" name="userId" value="{%s FromUInttoString(p.ID) %}" />
{% endif %}
<div class="field">
<label class="label">Username</label>
<div class="control">
<input class="input" name="username" type="text" value="{%s p.Username %}">
</div>
</div>
{% if p.ID == nil %}
<div class="field">
<label class="label">Password</label>
<div class="control">
<input class="input" name="password" type="password">
</div>
</div>
{% endif %}
<div class="field">
<label class="label">Root folder</label>
<div class="control">
<input class="input" name="path" type="text" value="{%s p.Path %}">
</div>
</div>
<div class="field">
<label class="label">Is Admin?</label>
<div class="control">
<input type="checkbox" name="isAdmin" type="password" {% if p.IsAdmin %}checked{% endif %}>
</div>
</div>
<div class="field">
<input class="button is-pulled-right" value="Save" type="submit">
</div>
</form>
{% endfunc %}
{% func (p *UserPage) Script() %}
{% endfunc %}
|