<h3><b>Choices</b></h3>
-<form action="poll">
+<form action="poll" method="post">
<input type="hidden" name="vote2" value="<% id %>">
<% val choices = Poll.listChoicesWithMyVotes id;
if #votes poll = 1 then %>
val votes = Web.stoi ($"votes");
if title = "" then
%><h3><b>Your poll must have a title.</b></h3><%
- elseif not (Poll.dateGeNow starts) then
+ elseif not pollAdmin and not (Poll.dateGeNow starts) then
%><h3><b>That start date is in the past!</b></h3><%
- elseif not (Poll.dateLe (starts, ends)) then
+ elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
%><h3><b>The end date comes before the start date!</b></h3><%
elseif votes <= 0 then
%><h3><b>You must specify a positive number of votes per person.</b></h3><%
Poll.requireCanModify poll %>
<h3><b>Modify poll</b></h3>
-<form action="poll">
+<form action="poll" method="post">
<input type="hidden" name="id" value="<% $"mod" %>">
<table>
<tr> <td align="right"><b>Title</b>:</td> <td><input name="title" value="<% Web.html (#title poll) %>"></td> </tr>
val votes = Web.stoi ($"votes");
if title = "" then
%><h3><b>Your poll must have a title.</b></h3><%
- elseif not (Poll.dateGeNow starts) then
+ elseif not pollAdmin and not (Poll.dateGeNow starts) then
%><h3><b>That start date is in the past!</b></h3><%
- elseif not (Poll.dateLe (starts, ends)) then
+ elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
%><h3><b>The end date comes before the start date!</b></h3><%
elseif votes <= 0 then
%><h3><b>You must specify a positive number of votes per person.</b></h3><%
val poll = Poll.lookupPoll (#pol cho);
Poll.requireCanModify poll %>
-<form action="poll">
+<form action="poll" method="post">
<input type="hidden" name="saveChoice" value="<% id %>">
<table>
<tr> <td align="right"><b>Text</b>:</td> <td><input name="descr" value="<% Web.html (#descr cho) %>"></td> </tr>
<h3><b>Vote Report</b></h3>
+<p>Voters:
+<% ref first = true;
+ foreach user in Poll.listPollVoters id do
+ if first then
+ first := false
+ else
+ %>, <%
+ end
+ %><a href="user?id=<% #id user %>"><% #name user %></a><%
+ end %></p>
+
<table>
<tr> <td align="right"><b>Poll#</b>:</td> <td><% id %></td> </tr>
<tr> <td align="right"><b>Title</b>:</td> <td><% Web.html (#title poll) %></td> </tr>
<h3><b>Choices<% if Poll.takingVotes poll then %><a href="poll?vote=<% id %>">(Vote!)</a><% end %></b></h3>
+<p><% Poll.countVoters (#id poll) %> people have voted.</p>
+
<% if Poll.takingVotes poll then %>
<table>
<tr> <td><b>You</b></td> <td><b>Total</b></td> </tr>
<% end %>
</table>
-<a href="poll?report=<% id %>">Vote Report</a>
<% else
foreach cho in Poll.listChoices id do %>
<li> <% Web.html (#descr cho) %>
<% end
end %>
+<a href="poll?report=<% id %>">Vote Report</a>
+
<% if canModify then %>
<br><hr><br>
<h3><b>Add a new choice</b></h3>
-<form action="poll">
+<form action="poll" method="post">
<input type="hidden" name="addChoice" value="<% id %>">
<table>
<tr> <td align="right"><b>Text</b>:</td> <td><input name="descr"></td> </tr>
<h3><b>Create a poll</b></h3>
-<form action="poll">
+<form action="poll" method="post">
<input type="hidden" name="cmd" value="add">
<table>
<tr> <td align="right"><b>Title</b>:</td> <td><input name="title"></td> </tr>