ctdo-trac/TracRendezVous/tracrendezvous/rendezvous/templates/vote.html

130 lines
8.4 KiB
HTML

<!DOCTYPE htm
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#rdate_begin").datepicker({"dateFormat" : "dd.mm.yy"});
$("#rdate_end").datepicker({"dateFormat" : "dd.mm.yy"});
$("#time_begin\:\\S*").datepicker({"dateFormat" : "dd.mm.yy"});
$("#time_end\:\\S*").datepicker({"dateFormat" : "dd.mm.yy"});
});
</script>
<title>Votes</title>
</head>
<body>
<div id="content">
<div id='rendezvous-main'>
<form py:with="canDelete = 'RENDEZVOUS_VOTE_DELETE' in perm; canModify = 'RENDEZVOUS_VOTE_MODIFY' in perm" py:if="votes" class='votes' method="post" action="">
<fieldset>
<py:choose test="">
<legend py:when="'RENDEZVOUS_VOTE_VIEW_OTHERS' in perm">All votes for ${rdate.time_begin.strftime('%x')}</legend>
<legend py:otherwise="">Votes for ${rdate.time_begin.strftime('%x')} made by $authname</legend>
</py:choose>
<table class="listing">
<thead>
<tr>
<py:if test="canModify">
<th>user</th>
<th>email</th>
<th>begin</th>
<th>end</th>
</py:if>
<th py:if="canDelete">delete</th>
</tr>
</thead>
<tbody py:choose="">
<tr py:when="canModify and canDelete" py:for="vote in votes" py:with="dt = vote.time_begin.astimezone(selected_tz);dt2 = vote.time_end.astimezone(selected_tz)">
<td>${vote.user}</td>
<td><input type="text" size="40" name="email:${vote.vote_id}" value="${vote.email}"/></td>
<td><input type="text" size="8" id="time_begin:${vote.vote_id}" name="date_begin:${vote.vote_id}" value="${dt.strftime('%d.%m.%Y')}" />
<input type="text" size="5" name="time_begin:${vote.vote_id}" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td>
<td><input type="text" size="8" id="time_end:${vote.vote_id}" name="date_end:${vote.vote_id}" value="${dt2.strftime('%d.%m.%Y')}" />
<input type="text" size="5" name="time_end:${vote.vote_id}" value="${dt2.strftime('%H:%M')}"/> ${dt2.tzinfo.tzname(None)}</td>
<td><input type="checkbox" name="delete" value="${vote.vote_id}" /></td>
</tr>
<tr py:when="not canModify and canDelete" py:for="vote in votes" py:with="dt = vote.time_begin.astimezone(selected_tz);dt2 = vote.time_end.astimezone(selected_tz)">
<td>${vote.user}</td>
<td>${vote.mail}</td>
<td>${dt.strftime('%d.%m.%Y')}
${dt.strftime('%H:%M')} ${dt.tzinfo.tzname(None)}</td>
<td>${dt2.strftime('%d.%m.%Y')}
${dt2.strftime('%H:%M')} ${dt2.tzinfo.tzname(None)}</td>
<td><input type="checkbox" name="delete" value="${vote.vote_id}"/></td>
</tr>
<tr py:when="canModify and not canDelete" py:for="vote in votes" py:with="dt = vote.time_begin.astimezone(selected_tz);dt2 = vote.time_end.astimezone(selected_tz)">
<td><input type="text" size="40" name="email:${vote.vote_id}" value="${vote.email}" /></td>
<td><input type="text" size="8" id="time_begin:${vote.vote_id}" name="date_begin:${vote.vote_id}" value="${dt.strftime('%d.%m.%Y')}" />
<input type="text" size="5" name="time_begin:${vote.vote_id}" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td>
<td><input type="text" size="8" id="time_end:${vote.vote_id}" name="date_end:${vote.vote_id}" value="${dt2.strftime('%d.%m.%Y')}" />
<input type="text" size="5" name="time_end:${vote.vote_id}" value="${dt2.strftime('%H:%M')}"/> ${dt2.tzinfo.tzname(None)}</td>
</tr>
<tr py:otherwise="" py:for="vote in votes">
<td>${vote.user}</td>
<td>${vote.time_begin.strftime('%d.%m.%Y')}</td>
<td>${dt.strftime('%H:%M')} ${dt.tzinfo.tzname(None)}</td>
<td>${dt2.strftime('%d.%m.%Y')}</td>
<td>${dt2.strftime('%H:%M')} ${dt2.tzinfo.tzname(None)}</td>
</tr>
</tbody>
</table>
</fieldset>
<div class="mybuttons">
<input type="reset" name="reset"/>
<input type="submit" name="savevotes" value="Save Changes"/>
</div>
</form>
<p class="help">Change or delete votes for an existing rendezvous date.</p>
<form py:if="'RENDEZVOUS_VOTE_ADD' in perm" action="" method="post" mime-type="text/plain">
<fieldset>
<legend>Add new vote for ${rdate.time_begin.strftime("%x")}:</legend>
<table>
<tr class="field">
<th><label for="dv_user">User:</label></th>
<td><input id="dv_user" type="text" name="user" value="${authname}"/></td>
</tr>
<tr class="field">
<th><label for="dv_email">Email:</label></th>
<td><input id="dv_email" type="text" name="email" /></td>
</tr>
<tr class="field" py:with="dt = rdate.time_begin.astimezone(selected_tz)">
<th><label for="dv_date_begin">Date Begin:</label></th>
<td><input id="rdate_begin" type="text" name="date_begin" value="${dt.strftime('%d.%m.%Y')}"/>
<input type="text" name="time_begin" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td>
</tr>
<tr class="field" py:with="dt = rdate.time_end.astimezone(selected_tz)">
<th><label for="dv_date_end">Date End:</label></th>
<td><input id="rdate_end" type="text" name="date_end" value="${dt.strftime('%d.%m.%Y')}"/>
<input type="text" name="time_end" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td>
</tr>
</table>
<div class="mybuttons">
<input type="submit" name="add" value="Add" />
</div>
</fieldset>
</form>
<p class="help">Add a vote to an existing rendezvous date.</p>
</div>
<h3>Allowed date/time formats:</h3>
<ul>
<li>time:
<ul>
<li>'hhMM'</li>
<li>'hh:MM'</li>
</ul>
</li>
<li>date:
<ul>
<li>'yyyymmdd'</li>
<li>'yyyy.mm.dd'</li>
</ul>
</li>
</ul>
</div>
</body>
</html>