summaryrefslogtreecommitdiff
path: root/templates/motions.html
diff options
context:
space:
mode:
authorJan Dittberner <jan@dittberner.info>2017-04-17 01:33:51 +0200
committerJan Dittberner <jan@dittberner.info>2017-04-22 00:12:24 +0200
commitf4360b98c8b3012bf27c75d9c04e7f9b737c9694 (patch)
tree7f613825ce57723a5ef3e9448e49a8c62dc34894 /templates/motions.html
parent74987ce184fb3c4ddc3d266aa19f7fcacd774bf0 (diff)
downloadcacert-boardvoting-f4360b98c8b3012bf27c75d9c04e7f9b737c9694.tar.gz
cacert-boardvoting-f4360b98c8b3012bf27c75d9c04e7f9b737c9694.tar.xz
cacert-boardvoting-f4360b98c8b3012bf27c75d9c04e7f9b737c9694.zip
Implement more RESTful URLs for motions
This commit implements URLs /motions/ and /motions/{:tag} handlers.
Diffstat (limited to 'templates/motions.html')
-rw-r--r--templates/motions.html24
1 files changed, 16 insertions, 8 deletions
diff --git a/templates/motions.html b/templates/motions.html
index fa1c07c..f717d78 100644
--- a/templates/motions.html
+++ b/templates/motions.html
@@ -6,14 +6,15 @@
<link rel="stylesheet" type="text/css" href="/static/styles.css"/>
</head>
<body>
-<a href="?unvoted=1">Show my outstanding votes</a><br/>
+<a href="/motions/?unvoted=1">Show my outstanding votes</a><br/>
+{{ $voter := .Voter }}
{{ if .Decisions }}
<table class="list">
<thead>
<tr>
<th>Status</th>
<th>Motion</th>
- <th>Actions</th>
+ {{ if $voter }}<th>Actions</th>{{ end }}
</tr>
</thead>
<tbody>
@@ -28,7 +29,7 @@
{{ end }}
</td>
<td>
- <i><a href="/motions?motion={{ .Tag}}">{{ .Tag}}</a></i><br />
+ <i><a href="/motions/{{ .Tag}}">{{ .Tag}}</a></i><br />
<b>{{ .Title}}</b><br />
<pre>{{ wrap 76 .Content }}</pre>
<br />
@@ -42,9 +43,10 @@
<i>{{ .Name }}: {{ .Vote}}</i><br />
{{ end }}
{{ else}}
- <i><a href="/motions?motion={{.Tag}}&showvotes=1">Show Votes</a></i>
+ <i><a href="/motions/{{.Tag}}?showvotes=1">Show Votes</a></i>
{{ end }}
</td>
+ {{ if $voter }}
<td>
{{ if eq .Status 0 }}
<ul>
@@ -52,17 +54,23 @@
<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="/motion/{{ .Tag }}">Modify</a></li>
- <li><a href="/motions?motion={{ .Tag }}&withdraw=1">Withdraw</a></li>
+ <li><a href="/motions/{{ .Tag }}/edit">Modify</a></li>
+ <li><a href="/motions/{{ .Tag }}/withdraw">Withdraw</a></li>
</ul>
{{ end }}
- </td>
+ </td>{{ end }}
</tr>
{{end}}
+ <tr>
+ <td colspan="{{ if $voter }}3{{ else }}2{{ end }}" class="navigation">
+ {{ if .PrevPage }}<a href="?page={{ .PrevPage }}" title="previous page">&lt;</a>{{ end }}
+ {{ if .NextPage }}<a href="?page={{ .NextPage }}" title="next page">&gt;</a>{{ end }}
+ </td>
+ </tr>
</tbody>
</table>
{{else}}
<p>There are no motions in the system yet.</p>
{{end}}
</body>
-</html> \ No newline at end of file
+</html>