summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJan Dittberner <jan@dittberner.info>2017-04-21 02:25:49 +0200
committerJan Dittberner <jan@dittberner.info>2017-04-22 00:14:08 +0200
commit2cac50ee86e70428aa06c99f5e009ceaaf1dbc13 (patch)
treeada4eb330be62598445480b6f40a5633ddfa922f /templates
parentb6ad5d8ad327066b21bdb690f5a5017f6bed9740 (diff)
downloadcacert-boardvoting-2cac50ee86e70428aa06c99f5e009ceaaf1dbc13.tar.gz
cacert-boardvoting-2cac50ee86e70428aa06c99f5e009ceaaf1dbc13.tar.xz
cacert-boardvoting-2cac50ee86e70428aa06c99f5e009ceaaf1dbc13.zip
Implement proxy voting
Diffstat (limited to 'templates')
-rw-r--r--templates/proxy_vote_form.html61
-rw-r--r--templates/proxy_vote_mail.txt13
2 files changed, 74 insertions, 0 deletions
diff --git a/templates/proxy_vote_form.html b/templates/proxy_vote_form.html
new file mode 100644
index 0000000..eb5c421
--- /dev/null
+++ b/templates/proxy_vote_form.html
@@ -0,0 +1,61 @@
+{{ template "header" . }}
+{{ $form := .Form }}
+<table class="list">
+ <thead>
+ <tr>
+ <th>Status</th>
+ <th>Motion</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ {{ with .Decision }}
+ {{ template "motion_fragment" .}}
+ {{ end }}
+ </tr>
+ </tbody>
+</table>
+<form action="/proxy/{{ .Decision.Tag }}" method="post">
+ <table>
+ <tr>
+ <th>Voter</th>
+ <th>Vote</th>
+ </tr>
+ <tr>
+ <td>
+ <select name="Voter">
+ {{ range .Voters }}
+ <option value="{{ .Id }}"
+ {{ if eq (.Id | print) $form.Voter }}
+ selected{{ end }}>{{ .Name }}</option>
+ {{ end }}
+ </select>
+ </td>
+ <td>
+ <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>
+ </td>
+ </tr>
+ <tr>
+ <th colspan="2">Justification:</th>
+ </tr>
+ <tr>
+ <td colspan="2"><textarea
+ name="Justification">{{ $form.Justification }}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"><input type="submit" value="Proxy Vote"></td>
+ </tr>
+ </table>
+</form>
+{{ template "footer" . }} \ No newline at end of file
diff --git a/templates/proxy_vote_mail.txt b/templates/proxy_vote_mail.txt
new file mode 100644
index 0000000..dd7403f
--- /dev/null
+++ b/templates/proxy_vote_mail.txt
@@ -0,0 +1,13 @@
+Dear Board,
+
+{{ .Proxy }} has just registered a proxy vote of {{ .Vote }} for {{ .Voter }} on motion {{ .Decision.Tag }}.
+
+The justification for this was:
+{{ .Justification }}
+
+Motion:
+{{ .Decision.Title }}
+{{ .Decision.Content }}
+
+Kind regards,
+the vote system \ No newline at end of file