cacert-boardvoting/templates/motion_fragments.html

92 lines
3.6 KiB
HTML

{{ define "motion_fragment" }}
<div class="column">
<div class="ui raised segment">
<span class="ui {{ template "status_class" .Status }} ribbon label">{{ .Status|toString|title }}</span>
<span class="header">{{ .Modified|date "2006-01-02 15:04:05 UTC" }}</span>
<h2 class="header"><a href="/motions/{{ .Tag }}">{{ .Tag }}: {{ .Title }}</a></h2>
<pre>{{ wrap 76 .Content }}</pre>
<table class="ui small definition table">
<tbody>
<tr>
<td>Due</td>
<td>{{.Due|date "2006-01-02 15:04:05 UTC"}}</td>
</tr>
<tr>
<td>Proposed</td>
<td>{{.Proposer}} ({{.Proposed|date "2006-01-02 15:04:05 UTC"}})</td>
</tr>
<tr>
<td>Vote type:</td>
<td>{{ .VoteType|toString|title }}</td>
</tr>
<tr>
<td>Votes:</td>
<td>
<div class="ui labels">
<div class="ui basic label green"><i class="check circle icon"></i>Aye<div class="detail">{{.Ayes}}</div></div>
<div class="ui basic label red"><i class="minus circle icon"></i>Naye<div class="detail">{{.Nayes}}</div></div>
<div class="ui basic label grey"><i class="circle icon"></i>Abstain<div class="detail">{{.Abstains}}</div></div>
</div>
{{ if .Votes }}
<div class="list">
{{ range .Votes }}
<div class="item">{{ .Name }}: {{ .Vote.Vote }}</div>
{{ end }}
</div>
<a href="/motions/{{ .Tag }}">Hide Votes</a>
{{ else }}
<a href="/motions/{{ .Tag }}?showvotes=1">Show Votes</a>
{{ end }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--
<td class="{{.Status}}">
{{ if eq .Status 0 }}Pending {{ .Due}}
{{ else if eq .Status 1}}Approved {{ .Modified}}
{{ else if eq .Status -1}}Declined {{ .Modified}}
{{ else if eq .Status -2}}Withdrawn {{ .Modified}}
{{ else }}Unknown
{{ end }}
</td>
<td>
<i><a href="/motions/{{ .Tag}}">{{ .Tag}}</a></i><br/>
<b>{{ .Title}}</b><br/>
<pre>{{ wrap 76 .Content }}</pre>
<br/>
<i>Due: {{.Due}}</i><br/>
<i>Proposed: {{.Proposer}} ({{.Proposed}})</i><br/>
<i>Vote type: {{.VoteType}}</i><br/>
<i>Aye|Naye|Abstain: {{.Ayes}}|{{.Nayes}}|{{.Abstains}}</i><br/>
{{ if .Votes }}
<i>Votes:</i><br/>
{{ range .Votes}}
<i>{{ .Name }}: {{ .Vote.Vote }}</i><br/>
{{ end }}
<i><a href="/motions/{{.Tag}}">Hide Votes</a></i>
{{ else}}
<i><a href="/motions/{{.Tag}}?showvotes=1">Show Votes</a></i>
{{ end }}
</td>
-->
{{ end }}
{{ define "status_class" }}{{ if eq . 0 }}blue{{ else if eq . 1 }}green{{ else if eq . -1 }}red{{ else if eq . -2 }}grey{{ end }}{{ end }}
{{ define "motion_actions" }}
<td>
{{ if eq .Status 0 }}
<ul>
<li><a href="/vote/{{ .Tag }}/aye">Aye</a></li>
<li><a href="/vote/{{ .Tag }}/abstain">Abstain</a></li>
<li><a href="/vote/{{ .Tag }}/naye">Naye</a></li>
<li><a href="/proxy/{{ .Tag }}">Proxy Vote</a></li>
<li><a href="/motions/{{ .Tag }}/edit">Modify</a></li>
<li><a href="/motions/{{ .Tag }}/withdraw">Withdraw</a></li>
</ul>
{{ end }}
</td>
{{ end }}