summaryrefslogtreecommitdiff
path: root/boardvoting/templates/proxy_vote_form.html
blob: 3a344c3fb2bb6d15f04d880c0f5e87e01c5fcd99 (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
{{ template "header.html" . }}
{{ $form := .Form }}
<div class="column">
    <div class="ui basic segment">
        <div class="ui floated right secondary menu">
            <a href="/motions/" class="item" title="Show all votes">Back to
                motions</a>
        </div>
    </div>
</div>
<div class="column">
    <div class="ui raised segment">
        {{ with .Decision }}
        {{ template "motion_fragment" . }}
        {{ end }}
        <form action="/proxy/{{ .Decision.Tag }}" method="post">
            <div class="ui form{{ if .Form.Errors }} error{{ end }}">
                <div class="two fields">
                    <div class="required field{{ if .Form.Errors.Voter }} error{{ end }}">
                        <label for="Voter">Voter</label>
                        <select name="Voter">
                            {{ range .Voters }}
                            <option value="{{ .Id }}"
                                    {{ if eq (.Id | print) $form.Voter }}
                                    selected{{ end }}>{{ .Name }}</option>
                            {{ end }}
                        </select>
                    </div>
                    <div class="required field{{ if .Form.Errors.Vote }} error{{ end }}">
                        <label for="Vote">Vote</label>
                        <select name="Vote">
                            <option value="1"{{ if eq .Form.Vote "1" }} selected{{ end }}>Aye</option>
                            <option value="0"{{ if eq .Form.Vote "0" }} selected{{ end }}>Abstain</option>
                            <option value="-1"{{ if eq .Form.Vote "-1" }} selected{{ end }}>Naye</option>
                        </select>
                    </div>
                </div>
                <div class="required field{{ if .Form.Errors.Justification }} error{{ end }}">
                    <label for="Justification">Justification</label>
                    <textarea name="Justification" rows="2">{{ .Form.Justification }}</textarea>
                </div>
                {{ with .Form.Errors }}
                <div class="ui error message">
                    {{ with .Voter }}<p>{{ . }}</p>{{ end }}
                    {{ with .Vote }}<p>{{ . }}</p>{{ end }}
                    {{ with .Justification }}<p>{{ . }}</p>{{ end }}
                </div>
                {{ end }}
                <button class="ui primary left labeled icon button" type="submit"><i class="users icon"></i> Proxy Vote</button>
            </div>
        </form>
    </div>
</div>
{{ template "footer.html" . }}