+elseif $"vote" <> "" then
+ showNormal := false;
+ val id = Web.stoi ($"vote");
+ val poll = Poll.lookupPoll id %>
+
+<table class="blanks">
+<tr> <td>Poll#:</td> <td><% id %></td> </tr>
+<tr> <td>Title:</td> <td><% Web.html (#title poll) %></td> </tr>
+<tr> <td>Start:</td> <td><% Web.html (#starts poll) %></td> </tr>
+<tr> <td>End:</td> <td><% Web.html (#ends poll) %></td> </tr>
+<tr> <td>Votes/person:</td> <td><% #votes poll %></td> </tr>
+<tr> <td>Description:</td> <td><% Web.htmlNl (#descr poll) %></td> </tr>
+</table>
+
+<h3>Choices</h3>
+
+<form action="poll" method="post">
+<input type="hidden" name="vote2" value="<% id %>">
+<% val choices = Poll.listChoicesWithMyVotes id;
+if #votes poll = 1 then %>
+<select name="v">
+<option value="">Abstain</option>
+<% else %>
+<select name="v" multiple size="<% length choices %>">
+<% end
+foreach (you, cho) in choices do %>
+ <option value="<% #id cho %>"<% if you then %> selected<% end %>><% Web.html (#descr cho) %></option>
+<% end %></select><br><br>
+<input type="submit" value="Vote">
+</form>
+
+<% elseif $"vote2" <> "" then
+ val id = Web.stoi ($"vote2");
+ val poll = Poll.lookupPoll id;
+ editingPoll := SOME id;
+
+ val votes = case Web.getMultiParam "v" of
+ [""] => []
+ | v => map Web.stoi v;
+
+ if length votes > #votes poll then
+ %><h3>You can't vote for that many different choices!</h3><%
+ elseif not (Poll.noDupes votes) then
+ %><h3>You can't vote multiple times for the same choice!</h3><%
+ else
+ Poll.vote (Init.getUserId (), id, votes)
+ %><h3>Thanks for voting!</h3>
+<% end
+