2010-08-05 11:23:17 -05:00
|
|
|
<tal:comment replace="nothing">View macro for a Date.</tal:comment>
|
|
|
|
<metal:view define-macro="view"><span tal:replace="value"/></metal:view>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Edit macro for an Date.</tal:comment>
|
|
|
|
<metal:edit define-macro="edit"
|
2012-01-02 09:59:11 -06:00
|
|
|
tal:define="years python: contextObj.getSelectableYears(widget['name'])">
|
2010-08-05 11:23:17 -05:00
|
|
|
<tal:comment replace="nothing">Day</tal:comment>
|
|
|
|
<select tal:define="days python:range(1,32)"
|
|
|
|
tal:attributes="name string:${name}_day;
|
|
|
|
id string:${name}_day;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<tal:days repeat="day days">
|
|
|
|
<option tal:define="zDay python: str(day).zfill(2)"
|
|
|
|
tal:attributes="value zDay;
|
2010-08-12 04:56:42 -05:00
|
|
|
selected python:contextObj.dateValueSelected(name, 'day', day, rawValue)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="zDay"></option>
|
|
|
|
</tal:days>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Month</tal:comment>
|
|
|
|
<select tal:define="months python:range(1,13)"
|
|
|
|
tal:attributes="name string:${name}_month;
|
|
|
|
id string:${name}_month;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<tal:months repeat="month months">
|
|
|
|
<option tal:define="zMonth python: str(month).zfill(2)"
|
|
|
|
tal:attributes="value zMonth;
|
2010-08-12 04:56:42 -05:00
|
|
|
selected python:contextObj.dateValueSelected(name, 'month', month, rawValue)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="zMonth"></option>
|
|
|
|
</tal:months>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Year</tal:comment>
|
|
|
|
<select tal:attributes="name string:${name}_year;
|
|
|
|
id string:${name}_year;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<option tal:repeat="year years"
|
|
|
|
tal:attributes="value year;
|
2010-08-12 04:56:42 -05:00
|
|
|
selected python:contextObj.dateValueSelected(name, 'year', year, rawValue)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="year"></option>
|
|
|
|
</select>
|
2012-01-02 09:59:11 -06:00
|
|
|
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
|
2013-04-30 04:45:31 -05:00
|
|
|
<tal:calendar condition="widget/calendar">
|
|
|
|
<input type="hidden" tal:attributes="id name; name name"/>
|
|
|
|
<img tal:attributes="id string:${name}_img; src string: $appUrl/ui/calendar.gif"/>
|
|
|
|
<script type="text/javascript" tal:content="python: contextObj.getCalendarInit(name, years)"></script>
|
|
|
|
</tal:calendar>
|
2010-08-05 11:23:17 -05:00
|
|
|
|
|
|
|
<tal:hour condition="python: widget['format'] == 0">
|
|
|
|
<select tal:define="hours python:range(0,24);"
|
|
|
|
tal:attributes="name string:${name}_hour;
|
|
|
|
id string:${name}_hour;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<tal:hours repeat="hour hours">
|
|
|
|
<option tal:define="zHour python: str(hour).zfill(2)"
|
|
|
|
tal:attributes="value zHour;
|
2010-08-12 04:56:42 -05:00
|
|
|
selected python:contextObj.dateValueSelected(name, 'hour', hour, rawValue)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="zHour"></option>
|
|
|
|
</tal:hours>
|
|
|
|
</select> :
|
|
|
|
<select tal:define="minutes python:range(0,60,5);"
|
|
|
|
tal:attributes="name string:${name}_minute;
|
|
|
|
id string:${name}_minute;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<tal:minutes repeat="minute minutes">
|
|
|
|
<option tal:define="zMinute python: str(minute).zfill(2)"
|
|
|
|
tal:attributes="value zMinute;
|
2010-08-12 04:56:42 -05:00
|
|
|
selected python:contextObj.dateValueSelected(name, 'minute', minute, rawValue)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="zMinute"></option>
|
|
|
|
</tal:minutes>
|
|
|
|
</select>
|
|
|
|
</tal:hour>
|
|
|
|
</metal:edit>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Cell macro for an Date.</tal:comment>
|
|
|
|
<metal:cell define-macro="cell">
|
2011-11-25 11:01:20 -06:00
|
|
|
<metal:call use-macro="app/ui/widgets/date/macros/view"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</metal:cell>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Search macro for an Date.</tal:comment>
|
2010-12-17 07:46:55 -06:00
|
|
|
<metal:search define-macro="search"
|
|
|
|
tal:define="years python:range(widget['startYear'], widget['endYear']+1)">
|
2012-06-03 11:34:56 -05:00
|
|
|
<label tal:content="python: _(widget['labelId'])"></label>
|
2011-10-04 13:12:58 -05:00
|
|
|
<table>
|
2010-08-05 11:23:17 -05:00
|
|
|
<tal:comment replace="nothing">From</tal:comment>
|
2012-01-02 09:59:11 -06:00
|
|
|
<tr tal:define="fromName python: '%s_from' % name;
|
2010-12-17 07:46:55 -06:00
|
|
|
dayFromName python: '%s_from_day' % name;
|
2012-01-02 09:59:11 -06:00
|
|
|
monthFromName python: '%s_from_month' % name;
|
|
|
|
yearFromName python: '%s*date' % widgetName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<td width="10px"> </td>
|
|
|
|
<td>
|
2012-06-03 11:34:56 -05:00
|
|
|
<label tal:content="python: _('search_from')"></label>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2012-01-02 09:59:11 -06:00
|
|
|
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="id dayFromName; name dayFromName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
2010-12-17 07:46:55 -06:00
|
|
|
<option tal:repeat="value python: [str(v).zfill(2) for v in range(1, 32)]"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
2012-01-02 09:59:11 -06:00
|
|
|
</select> /
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="id monthFromName; name monthFromName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
|
|
|
<option tal:repeat="value python: [str(v).zfill(2) for v in range(1, 13)]"
|
2012-01-02 09:59:11 -06:00
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
2010-08-05 11:23:17 -05:00
|
|
|
</select> /
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="id yearFromName; name yearFromName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
2010-12-17 07:46:55 -06:00
|
|
|
<option tal:repeat="value python:range(widget['startYear'], widget['endYear']+1)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
|
|
|
</select>
|
2012-01-02 09:59:11 -06:00
|
|
|
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
|
2013-04-30 04:45:31 -05:00
|
|
|
<tal:calendar condition="widget/calendar">
|
|
|
|
<input type="hidden" tal:attributes="id fromName; name fromName"/>
|
|
|
|
<img tal:attributes="id string:${fromName}_img; src string: $appUrl/ui/calendar.gif"/>
|
|
|
|
<script type="text/javascript" tal:content="python: tool.getCalendarInit(fromName, years)"></script>
|
|
|
|
</tal:calendar>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tal:comment replace="nothing">To</tal:comment>
|
2012-01-02 09:59:11 -06:00
|
|
|
<tr tal:define="toName python: '%s_to' % name;
|
|
|
|
dayToName python: '%s_to_day' % name;
|
2010-12-17 07:46:55 -06:00
|
|
|
monthToName python: '%s_to_month' % name;
|
2012-01-02 09:59:11 -06:00
|
|
|
yearToName python: '%s_to_year' % name">
|
2010-08-05 11:23:17 -05:00
|
|
|
<td></td>
|
|
|
|
<td>
|
2012-06-03 11:34:56 -05:00
|
|
|
<label tal:content="python: _('search_to')"></label>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
2010-12-17 07:46:55 -06:00
|
|
|
<td height="20px;">
|
|
|
|
<select tal:attributes="id dayToName; name dayToName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
2010-12-17 07:46:55 -06:00
|
|
|
<option tal:repeat="value python: [str(v).zfill(2) for v in range(1, 32)]"
|
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
2010-08-05 11:23:17 -05:00
|
|
|
</select> /
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="id monthToName; name monthToName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
|
|
|
<option tal:repeat="value python: [str(v).zfill(2) for v in range(1, 13)]"
|
2012-01-02 09:59:11 -06:00
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
2010-08-05 11:23:17 -05:00
|
|
|
</select> /
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="id yearToName; name yearToName">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option value="">--</option>
|
2010-12-17 07:46:55 -06:00
|
|
|
<option tal:repeat="value python:range(widget['startYear'], widget['endYear']+1)"
|
|
|
|
tal:content="value" tal:attributes="value value"></option>
|
2010-08-05 11:23:17 -05:00
|
|
|
</select>
|
2012-01-02 09:59:11 -06:00
|
|
|
<tal:comment replace="nothing">The icon for displaying the calendar popup</tal:comment>
|
2013-04-30 04:45:31 -05:00
|
|
|
<tal:calendar condition="widget/calendar">
|
|
|
|
<input type="hidden" tal:attributes="id toName; name toName"/>
|
|
|
|
<img tal:attributes="id string:${toName}_img; src string: $appUrl/ui/calendar.gif"/>
|
|
|
|
<script type="text/javascript" tal:content="python: tool.getCalendarInit(toName, years)"></script>
|
|
|
|
</tal:calendar>
|
2010-08-05 11:23:17 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</metal:search>
|