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

107 lines
6.0 KiB
HTML
Raw Normal View History

2012-03-31 15:45:24 +00:00
<!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($) {
$("input[name^='date_begin']").datepicker({"dateFormat" : "dd.mm.yy", altField: "#date_end"});
$("input[name^='date_end']").datepicker({"dateFormat" : "dd.mm.yy"});
});
</script>
<title>Dates</title>
</head>
<body>
<div id="content" py:if="rendezvous">
<div id='rendezvous-main'>
<py:choose>
<py:when test="'RENDEZVOUS_DATE_MODIFY' in perm or 'RENDEZVOUS_DATE_ADD' in perm or 'RENDEZVOUS_DATE_DELETE' in perm">
<form py:if="len(dates) > 0" class='votes' method="post" action="">
<fieldset >
<legend>Dates for ${rendezvous.name}</legend>
<input type="hidden" name="item" value="${rendezvous.rendezvous_id}"/>
<table class="listing">
<thead>
<tr>
<th>author</th>
<th>email</th>
<th>date begin</th>
<th>time begin</th>
<th>date end</th>
<th>time end</th>
<th>delete</th>
</tr>
</thead>
<py:for each="date in dates">
<tr py:with="dt = selected_tz.fromutc(date.time_begin);
dt2 = selected_tz.fromutc(date.time_end)">
<td>${date.author}</td>
<td><input type="text" size="25" name="email:${date.date_id}" value="${date.email}"/></td>
<td><input type="text" size="10" maxlength="10" name="date_begin:${date.date_id}" value="${date.time_begin.strftime('%d.%m.%Y')}"/></td>
<td><input type="text" size="5" maxlength="5" name="time_begin:${date.date_id}" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td>
<td><input type="text" size="10" maxlength="10" id="date_end" name="date_end:${date.date_id}" value="${date.time_end.strftime('%d.%m.%Y')}"/></td>
<td><input type="text" size="5" maxlength="5" name="time_end:${date.date_id}" value="${dt2.strftime('%H:%M')}"/> ${dt2.tzinfo.tzname(None)}</td>
<td><input type="checkbox" name="delete" value="${date.date_id}"/></td>
</tr>
</py:for>
</table>
</fieldset>
<p class="help">Change or delete votes for an existing rendezvous date.</p>
<div class="mybuttons">
<input type="reset" name="reset"/>
<input type="submit" name="savedates" value="Save Changes"/>
</div>
</form>
<form class='rendezvous-wizard' method="post" mime-type="text/plain">
<input type="hidden" name="rendezvous_id" value="$rendezvous.rendezvous_id"/>
<fieldset id="properties">
<legend>New Date</legend>
<table class="rendezvous-wizard" py:with="dt = selected_tz.fromutc(new_date.time_begin);
dt2 = selected_tz.fromutc(new_date.time_end)">
<tr><th><label for="nd_email">Email:</label></th><td><input id="nd_email" type="text" size="24" maxlength="25" name="email"/></td></tr>
<tr><th><label for="nd_date_begin">Date begin:</label></th><td><input id="nd_date_begin" type="text" size="10" maxlength="10" name="date_begin" value="${new_date.time_begin.strftime('%d.%m.%Y')}"/>
<input id="nd_time_begin" type="text" size="5" maxlength="5" name="time_begin" value="${dt.strftime('%H:%M')}"/> ${dt.tzinfo.tzname(None)}</td></tr>
<tr><th><label for="date_end">Date end:</label></th><td><input id="date_end" type="text" size="10" maxlength="10" name="date_end" value="${new_date.time_end.strftime('%d.%m.%Y')}"/>
<input id="nd_time_end" type="text" size="5" maxlength="5" name="time_end" value="${dt2.strftime('%H:%M')}"/> ${dt2.tzinfo.tzname(None)}</td></tr>
<tr><th><label for="nd_autovoting">Vote that for me!</label></th><td><input id="nd_autovoting" type="checkbox" checked="checked" name="autovoting"/></td></tr>
</table>
</fieldset>
<div class="mybuttons">
<input type="reset" name="reset"/>
<input type="submit" name="newdate" value=" Add " />
</div>
</form>
</py:when>
<h3>Allowed date/time formats:</h3>
<ul>
<li>yyyymmdd</li>
<li>yyyy.mm.dd</li>
</ul>
<py:otherwise>
<h2>Dates for ${rendezvous.name}</h2>
<table class="listing">
<thead>
<tr>
<th>author</th>
<th>day</th>
<th>day part</th>
</tr>
</thead>
<tbody>
<tr py:for="date in dates">
<td>${date.author}</td>
<td>${date.time_begin.strftime('%d.%m.%Y %H:%M')}</td>
<td>${date.time_end.strftime('%d.%m.%Y %H:%M')}</td>
</tr>
</tbody>
</table>
</py:otherwise>
</py:choose>
</div>
</div>
</body>
</html>