Implement proper model, actions and template structure
[cacert-boardvoting.git] / templates / motion_fragments.html
1 {{ define "motion_fragment" }}
2 <td class="{{.Status}}">
3 {{ if eq .Status 0 }}Pending {{ .Due}}
4 {{ else if eq .Status 1}}Approved {{ .Modified}}
5 {{ else if eq .Status -1}}Declined {{ .Modified}}
6 {{ else if eq .Status -2}}Withdrawn {{ .Modified}}
7 {{ else }}Unknown
8 {{ end }}
9 </td>
10 <td>
11 <i><a href="/motions/{{ .Tag}}">{{ .Tag}}</a></i><br/>
12 <b>{{ .Title}}</b><br/>
13 <pre>{{ wrap 76 .Content }}</pre>
14 <br/>
15 <i>Due: {{.Due}}</i><br/>
16 <i>Proposed: {{.Proposer}} ({{.Proposed}})</i><br/>
17 <i>Vote type: {{.VoteType}}</i><br/>
18 <i>Aye|Naye|Abstain: {{.Ayes}}|{{.Nayes}}|{{.Abstains}}</i><br/>
19 {{ if .Votes }}
20 <i>Votes:</i><br/>
21 {{ range .Votes}}
22 <i>{{ .Name }}: {{ .Vote.Vote }}</i><br/>
23 {{ end }}
24 <i><a href="/motions/{{.Tag}}">Hide Votes</a></i>
25 {{ else}}
26 <i><a href="/motions/{{.Tag}}?showvotes=1">Show Votes</a></i>
27 {{ end }}
28 </td>
29 {{ end }}
30 {{ define "motion_actions" }}
31 <td>
32 {{ if eq .Status 0 }}
33 <ul>
34 <li><a href="/vote/{{ .Tag }}/aye">Aye</a></li>
35 <li><a href="/vote/{{ .Tag }}/abstain">Abstain</a></li>
36 <li><a href="/vote/{{ .Tag }}/naye">Naye</a></li>
37 <li><a href="/proxy/{{ .Tag }}">Proxy Vote</a></li>
38 <li><a href="/motions/{{ .Tag }}/edit">Modify</a></li>
39 <li><a href="/motions/{{ .Tag }}/withdraw">Withdraw</a></li>
40 </ul>
41 {{ end }}
42 </td>
43 {{ end }}