cvsimport
[hcoop/zz_old/portal.git] / poll.mlt
index 9cc9c60..505044f 100644 (file)
--- a/poll.mlt
+++ b/poll.mlt
@@ -8,7 +8,7 @@ ref showNormal = true;
 if $"cmd" = "list" then
        showNormal := false %>
 
-<h2><b>All polls</b></h2>
+<h2>All polls</h2>
 
 <% foreach pol in Poll.listPolls () do %>
 <li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
@@ -21,18 +21,18 @@ elseif $"vote" <> "" then
        val id = Web.stoi ($"vote");
        val poll = Poll.lookupPoll id %>
 
-<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>
-<tr> <td align="right"><b>Start</b>:</td> <td><% Web.html (#starts poll) %></td> </tr>
-<tr> <td align="right"><b>End</b>:</td> <td><% Web.html (#ends poll) %></td> </tr>
-<tr> <td align="right"><b>Votes/person</b>:</td> <td><% #votes poll %></td> </tr>
-<tr> <td align="right" valign="top"><b>Description</b>:</td> <td><% Web.htmlNl (#descr poll) %></td> </tr>
+<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><b>Choices</b></h3>
+<h3>Choices</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 %>
@@ -57,12 +57,12 @@ foreach (you, cho) in choices do %>
                | v => map Web.stoi v;
 
        if length votes > #votes poll then
-               %><h3><b>You can't vote for that many different choices!</b></h3><%
+               %><h3>You can't vote for that many different choices!</h3><%
        elseif not (Poll.noDupes votes) then
-               %><h3><b>You can't vote multiple times for the same choice!</b></h3><%
+               %><h3>You can't vote multiple times for the same choice!</h3><%
        else
                Poll.vote (Init.getUserId (), id, votes)
-               %><h3><b>Thanks for voting!</b></h3>
+               %><h3>Thanks for voting!</h3>
 <%     end
 
 elseif $"cmd" = "add" then
@@ -71,17 +71,17 @@ elseif $"cmd" = "add" then
        val ends = $"ends";
        val votes = Web.stoi ($"votes");
        if title = "" then
-               %><h3><b>Your poll must have a title.</b></h3><%
+               %><h3>Your poll must have a title.</h3><%
        elseif not pollAdmin and not (Poll.dateGeNow starts) then
-               %><h3><b>That start date is in the past!</b></h3><%
+               %><h3>That start date is in the past!</h3><%
        elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
-               %><h3><b>The end date comes before the start date!</b></h3><%
+               %><h3>The end date comes before the start date!</h3><%
        elseif votes <= 0 then
-               %><h3><b>You must specify a positive number of votes per person.</b></h3><%
+               %><h3>You must specify a positive number of votes per person.</h3><%
        else
                val id = Poll.addPoll (Init.getUserId(), title, $"descr", starts, ends, votes);
                editingPoll := SOME id;
-               %><h3><b>Poll added!</b></h3><%
+               %><h3>Poll added!</h3><%
        end
 
 elseif $"mod" <> "" then
@@ -89,16 +89,16 @@ elseif $"mod" <> "" then
        val poll = Poll.lookupPoll (Web.stoi ($"mod"));
 
        Poll.requireCanModify poll %>
-<h3><b>Modify poll</b></h3>
+<h3>Modify poll</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>
-<tr> <td align="right"><b>Start date</b>:</td> <td><input name="starts" value="<% Web.html (#starts poll) %>"></td> </tr>
-<tr> <td align="right"><b>End date</b>:</td> <td><input name="ends" value="<% Web.html (#ends poll) %>"></td> </tr>
-<tr> <td align="right"><b>Max votes/person</b>:</td> <td><input name="votes" value="<% #votes poll %>"></td> </tr>
-<tr> <td align="right" valign="top"><b>Description</b>:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80"><% Web.html (#descr poll) %></textarea></td> </tr>
+<table class="blanks">
+<tr> <td>Title:</td> <td><input name="title" value="<% Web.html (#title poll) %>"></td> </tr>
+<tr> <td>Start date:</td> <td><input name="starts" value="<% Web.html (#starts poll) %>"></td> </tr>
+<tr> <td>End date:</td> <td><input name="ends" value="<% Web.html (#ends poll) %>"></td> </tr>
+<tr> <td>Max votes/person:</td> <td><input name="votes" value="<% #votes poll %>"></td> </tr>
+<tr> <td>Description:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80"><% Web.html (#descr poll) %></textarea></td> </tr>
 <tr> <td><input type="submit" name="cmd" value="Save"></td> </tr>
 </table>
 </form>
@@ -113,41 +113,41 @@ elseif $"mod" <> "" then
        val ends = $"ends";
        val votes = Web.stoi ($"votes");
        if title = "" then
-               %><h3><b>Your poll must have a title.</b></h3><%
+               %><h3>Your poll must have a title.</h3><%
        elseif not pollAdmin and not (Poll.dateGeNow starts) then
-               %><h3><b>That start date is in the past!</b></h3><%
+               %><h3>That start date is in the past!</h3><%
        elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
-               %><h3><b>The end date comes before the start date!</b></h3><%
+               %><h3>The end date comes before the start date!</h3><%
        elseif votes <= 0 then
-               %><h3><b>You must specify a positive number of votes per person.</b></h3><%
+               %><h3>You must specify a positive number of votes per person.</h3><%
        else
                Poll.modPoll {poll with title = title, descr = $"descr", starts = starts, ends = ends, votes = votes};
                editingPoll := SOME (#id poll);
-               %><h3><b>Poll record saved.</b></h3><%
+               %><h3>Poll record saved.</h3><%
        end
 
 elseif $"del" <> "" then
        Group.requireGroupName "poll";
        showNormal := false;
        val poll = Poll.lookupPoll (Web.stoi ($"del")) %>
-       <h3><b>Are you sure you want to delete poll <a href="poll?id=<% #id poll %>"><% Web.html (#title poll) %></a>?</b></h3>
+       <h3>Are you sure you want to delete poll <a href="poll?id=<% #id poll %>"><% Web.html (#title poll) %></a>?</h3>
        <a href="poll?del2=<% $"del" %>">Yes, delete <% Web.html (#title poll) %>!</a>
 
 <% elseif $"del2" <> "" then
        Group.requireGroupName "poll";
        val poll = Poll.lookupPoll (Web.stoi ($"del2"));
        Poll.deletePoll (Web.stoi ($"del2")) %>
-       <h3><b><% Web.html (#title poll) %> deleted!</b></h3>
+       <h3><% Web.html (#title poll) %> deleted!</h3>
 
 <% elseif $"addChoice" <> "" then
        val id = Web.stoi ($"addChoice");
        editingPoll := SOME id;
        val descr = $"descr";
        if descr = "" then
-               %><h3><b>Your poll choice must have a description.</b></h3><%
+               %><h3>Your poll choice must have a description.</h3><%
        else
                val id = Poll.addChoice (id, Web.stor ($"seq"), descr);
-               %><h3><b>Choice added!</b></h3><%
+               %><h3>Choice added!</h3><%
        end
 
 elseif $"modChoice" <> "" then
@@ -157,11 +157,11 @@ elseif $"modChoice" <> "" then
        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>
-<tr> <td align="right"><b>Sequence#</b>:</td> <td><input name="seq" value="<% #seq cho %>"></td> </tr>
+<table class="blanks">
+<tr> <td>Text:</td> <td><input name="descr" value="<% Web.html (#descr cho) %>"></td> </tr>
+<tr> <td>Sequence#:</td> <td><input name="seq" value="<% #seq cho %>"></td> </tr>
 <tr> <td><input type="submit" value="Save"></td> </tr>
 </table>
 </form>
@@ -174,10 +174,10 @@ elseif $"modChoice" <> "" then
        editingPoll := SOME (#id poll);
        val descr = $"descr";
        if descr = "" then
-               %><h3><b>Your poll choice must have a description.</b></h3><%
+               %><h3>Your poll choice must have a description.</h3><%
        else
                Poll.modChoice {cho with seq = Web.stor ($"seq"), descr = descr};
-               %><h3><b>Choice saved!</b></h3><%
+               %><h3>Choice saved!</h3><%
        end
 
 elseif $"delChoice" <> "" then
@@ -186,7 +186,7 @@ elseif $"delChoice" <> "" then
        val poll = Poll.lookupPoll (#pol cho);
        Poll.requireCanModify poll;
        showNormal := false %>
-       <h3><b>Are you sure you want to delete choice "<% Web.html (#descr cho) %>"</a>?</b></h3>
+       <h3>Are you sure you want to delete choice "<% Web.html (#descr cho) %>"</a>?</h3>
        <a href="poll?delChoice2=<% $"delChoice" %>">Yes, delete "<% Web.html (#descr cho) %>"!</a>
 
 <% elseif $"delChoice2" <> "" then
@@ -196,7 +196,7 @@ elseif $"delChoice" <> "" then
        Poll.requireCanModify poll;
        Poll.deleteChoice id;
        editingPoll := SOME (#id poll) %>
-       <h3><b>"<% Web.html (#descr cho) %>" deleted!</b></h3>
+       <h3>"<% Web.html (#descr cho) %>" deleted!</h3>
 
 <% elseif $"report" <> "" then
        showNormal := false;
@@ -205,7 +205,7 @@ elseif $"delChoice" <> "" then
        val poll = Poll.lookupPoll id;
        val canModify = Poll.canModify poll %>
 
-<h3><b>Vote Report</b></h3>
+<h3>Vote Report</h3>
 
 <p>Voters:
 <%     ref first = true;
@@ -218,13 +218,13 @@ elseif $"delChoice" <> "" then
                %><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>
-<tr> <td align="right"><b>Start</b>:</td> <td><% Web.html (#starts poll) %></td> </tr>
-<tr> <td align="right"><b>End</b>:</td> <td><% Web.html (#ends poll) %></td> </tr>
-<tr> <td align="right"><b>Votes/person</b>:</td> <td><% #votes poll %></td> </tr>
-<tr> <td align="right" valign="top"><b>Description</b>:</td> <td><% Web.htmlNl (#descr poll) %></td> </tr>
+<table class="blanks">
+<tr> <td>Poll#</b>:</td> <td><% id %></td> </tr>
+<tr> <td>Title</b>:</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>
 
 <br><hr><br>
@@ -256,17 +256,17 @@ end %>
                val poll = Poll.lookupPoll id;
                val canModify = Poll.canModify poll %>
 
-<table>
+<table class="blanks">
 <% if canModify then %><tr> <td></td> <td><a href="poll?mod=<% id %>">Edit poll data</a></td> </tr><% end %>
-<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>
-<tr> <td align="right"><b>Start</b>:</td> <td><% Web.html (#starts poll) %></td> </tr>
-<tr> <td align="right"><b>End</b>:</td> <td><% Web.html (#ends poll) %></td> </tr>
-<tr> <td align="right"><b>Votes/person</b>:</td> <td><% #votes poll %></td> </tr>
-<tr> <td align="right" valign="top"><b>Description</b>:</td> <td><% Web.htmlNl (#descr poll) %></td> </tr>
+<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><b>Choices<% if Poll.takingVotes poll then %><a href="poll?vote=<% id %>">(Vote!)</a><% end %></b></h3>
+<h3>Choices<% if Poll.takingVotes poll then %><a href="poll?vote=<% id %>">(Vote!)</a><% end %></h3>
 
 <p><% Poll.countVoters (#id poll) %> people have voted.</p>
 
@@ -285,7 +285,6 @@ end %>
 <% end %>
 </table>
 
-<a href="poll?report=<% id %>">Vote Report</a>
 <% else
 foreach cho in Poll.listChoices id do %>
        <li> <% Web.html (#descr cho) %>
@@ -297,15 +296,17 @@ foreach cho in Poll.listChoices id do %>
 <% end
 end %>
 
+<a href="poll?report=<% id %>">Vote Report</a>
+
 <% if canModify then %>
 <br><hr><br>
-<h3><b>Add a new choice</b></h3>
+<h3>Add a new choice</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>
-<tr> <td align="right"><b>Sequence#</b>:</td> <td><input name="seq" value="<% Poll.nextSeq id %>"></td> </tr>
+<table class="blanks">
+<tr> <td>Text:</td> <td><input name="descr"></td> </tr>
+<tr> <td>Sequence#:</td> <td><input name="seq" value="<% Poll.nextSeq id %>"></td> </tr>
 <tr> <td><input type="submit" value="Add"></td> </tr>
 </table>
 </form>
@@ -316,16 +317,16 @@ if showNormal then %>
 
 <a href="poll?cmd=list">Show all polls</a><br>
 
-<h3><b>Create a poll</b></h3>
+<h3>Create a poll</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>
-<tr> <td align="right"><b>Start date</b>:</td> <td><input name="starts"></td> </tr>
-<tr> <td align="right"><b>End date</b>:</td> <td><input name="ends"></td> </tr>
-<tr> <td align="right"><b>Max votes/person</b>:</td> <td><input name="votes"></td> </tr>
-<tr> <td align="right" valign="top"><b>Description</b>:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80"></textarea></td> </tr>
+<table class="blanks">
+<tr> <td>Title:</td> <td><input name="title"></td> </tr>
+<tr> <td>Start date:</td> <td><input name="starts"></td> </tr>
+<tr> <td>End date:</td> <td><input name="ends"></td> </tr>
+<tr> <td>Max votes/person:</td> <td><input name="votes"></td> </tr>
+<tr> <td>Description:</td> <td><textarea name="descr" wrap="soft" rows="5" cols="80"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Create"></td> </tr>
 </table>
 </form>