dbe59c2209043e2f736f34e301c1b23e13c9af9c
[cacert-boardvoting.git] / boardvoting / templates / motion_fragments.html
1 {{ define "motion_fragment" }}
2 <span class="ui {{ template "status_class" .Status }} ribbon label">{{ .Status|toString|title }}</span>
3 <span class="header">{{ .Modified|date "2006-01-02 15:04:05 UTC" }}</span>
4 <h3 class="header"><a href="/motions/{{ .Tag }}">{{ .Tag }}: {{ .Title }}</a></h3>
5 <p>{{ wrap 76 .Content | nl2br }}</p>
6 <table class="ui small definition table">
7 <tbody>
8 <tr>
9 <td>Due</td>
10 <td>{{.Due|date "2006-01-02 15:04:05 UTC"}}</td>
11 </tr>
12 <tr>
13 <td>Proposed</td>
14 <td>{{.Proposer}} ({{.Proposed|date "2006-01-02 15:04:05 UTC"}})</td>
15 </tr>
16 <tr>
17 <td>Vote type:</td>
18 <td>{{ .VoteType|toString|title }}</td>
19 </tr>
20 <tr>
21 <td>Votes:</td>
22 <td>
23 <div class="ui labels">
24 <div class="ui basic label green"><i
25 class="check circle icon"></i>Aye
26 <div class="detail">{{.Ayes}}</div>
27 </div>
28 <div class="ui basic label red"><i
29 class="minus circle icon"></i>Naye
30 <div class="detail">{{.Nayes}}</div>
31 </div>
32 <div class="ui basic label grey"><i class="circle icon"></i>Abstain
33 <div class="detail">{{.Abstains}}</div>
34 </div>
35 </div>
36 {{ if .Votes }}
37 <div class="list">
38 {{ range .Votes }}
39 <div class="item">{{ .Name }}: {{ .Vote.Vote }}</div>
40 {{ end }}
41 </div>
42 <a href="/motions/{{ .Tag }}">Hide Votes</a>
43 {{ else if or ((ne 0 .Ayes) (ne 0 .Nayes) (ne 0 .Abstains)) }}
44 <a href="/motions/{{ .Tag }}?showvotes=1">Show Votes</a>
45 {{ end }}
46 </td>
47 </tr>
48 </tbody>
49 </table>
50 {{ end }}
51
52 {{ define "status_class" }}{{ if eq . 0 }}blue{{ else if eq . 1 }}green{{ else if eq . -1 }}red{{ else if eq . -2 }}grey
53 {{ end }}{{ end }}
54
55 {{ define "motion_actions" }}
56 {{ if eq .Status 0 }}
57 <a class="ui compact right labeled green icon button" href="/vote/{{ .Tag }}/aye"><i class="check circle icon"></i> Aye</a>
58 <a class="ui compact right labeled red icon button" href="/vote/{{ .Tag }}/naye"><i class="minus circle icon"></i> Naye</a>
59 <a class="ui compact right labeled grey icon button" href="/vote/{{ .Tag }}/abstain"><i class="circle icon"></i> Abstain</a>
60 <a class="ui compact left labeled icon button" href="/proxy/{{ .Tag }}"><i class="users icon"></i> Proxy Vote</a>
61 <a class="ui compact left labeled icon button" href="/motions/{{ .Tag }}/edit"><i class="edit icon"></i> Modify</a>
62 <a class="ui compact left labeled icon button" href="/motions/{{ .Tag }}/withdraw"><i class="trash icon"></i> Withdraw</a>
63 {{ end }}
64 {{ end }}