summaryrefslogtreecommitdiff
path: root/boardvoting/templates/edit_motion_form.html
blob: f686183a2bee01aef55ee1174b7218d0295cb2ac (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{{ template "header" . }}
<div class="column">
    <div class="ui floated right secondary menu">
        <a href="/motions/" class="item" title="Show all votes">Back to
            motions</a>
    </div>
</div>
<div class="column">
    <div class="ui raised segment">
        <form action="/motions/{{ .Form.Decision.Tag }}/edit" method="post">
            <div class="ui form{{ if .Form.Errors }} error{{ end }}">
                <div class="three fields">
                    <div class="field">
                        <label>ID:</label>
                        <a href="/motions/{{ .Form.Decision.Tag }}">{{ .Form.Decision.Tag }}</a>
                    </div>
                    <div class="field">
                        <label>Proponent:</label>
                        {{ .Voter.Name }}
                    </div>
                    <div class="field">
                        <label>Proposed date/time:</label>
                        {{ .Form.Decision.Proposed|date "2006-01-02 15:04:05 UTC" }}
                    </div>
                </div>
                <div class="required field{{ if .Form.Errors.Title }} error{{ end }}">
                    <label for="Title">Title:</label>
                    <input name="Title" type="text" value="{{ .Form.Title }}">
                </div>
                <div class="required field{{ if .Form.Errors.Content }} error{{ end }}">
                    <label for="Content">Text:</label>
                    <textarea name="Content">{{ .Form.Content }}</textarea>
                </div>
                <div class="two fields">
                    <div class="required field{{ if .Form.Errors.VoteType }} error{{ end }}">
                        <label for="VoteType">Vote type:</label>
                        <select name="VoteType">
                            <option value="0"
                                    {{ if eq "0" .Form.VoteType }}selected{{ end }}>
                                Motion
                            </option>
                            <option value="1"
                                    {{ if eq "1" .Form.VoteType }}selected{{ end }}>
                                Veto
                            </option>
                        </select>
                    </div>
                    <div class="required field{{ if .Form.Errors.Due }} error{{ end }}">
                        <label for="Due">Due: (autofilled from chosen
                            option)</label>
                        <select name="Due">
                            <option value="+3 days">In 3 Days</option>
                            <option value="+7 days">In 1 Week</option>
                            <option value="+14 days">In 2 Weeks</option>
                            <option value="+28 days">In 4 Weeks</option>
                        </select>
                    </div>
                </div>
                {{ with .Form.Errors }}
                <div class="ui error message">
                    {{ with .Title }}<p>{{ . }}</p>{{ end }}
                    {{ with .Content }}<p>{{ . }}</p>{{ end }}
                    {{ with .VoteType }}<p>{{ . }}</p>{{ end }}
                    {{ with .Due }}<p>{{ . }}</p>{{ end }}
                </div>
                {{ end }}
                <button class="ui button" type="submit">Propose</button>
            </div>
        </form>
    </div>
</div>
{{ template "footer" . }}