[848] | 1 | <tal:block define="mode options/mode; |
---|
| 2 | id here/getWidgetId; |
---|
| 3 | id_date string:${id}_date; |
---|
| 4 | id_hour string:${id}_hour; |
---|
| 5 | id_minute string:${id}_minute; |
---|
| 6 | value options/datastructure/?id; |
---|
| 7 | date options/datastructure/?id_date; |
---|
| 8 | hour options/datastructure/?id_hour; |
---|
| 9 | minute options/datastructure/?id_minute; |
---|
| 10 | fmt here/view_format; |
---|
| 11 | "> |
---|
| 12 | <tal:block condition="python: mode == 'view'"> |
---|
| 13 | <span tal:replace="python:here.getDateStr(value, fmt=fmt)" /> |
---|
| 14 | </tal:block> |
---|
| 15 | <tal:block define="name here/getHtmlWidgetId; |
---|
| 16 | date_day_fmt python:fmt.startswith('iso8601') |
---|
| 17 | and 'iso8601_short' or 'short'" |
---|
| 18 | condition="python: mode == 'edit'"> |
---|
| 19 | <input type="text" size="11" maxlength="22" |
---|
| 20 | tal:attributes="name string:${name}_date; |
---|
| 21 | id string:${name}_date; |
---|
| 22 | value python:here.getDateStr(value, fmt=date_day_fmt)" /> |
---|
| 23 | |
---|
| 24 | <tal:block condition="here/time_setting" |
---|
| 25 | define="hours python:range(0,24);minutes python:(0,10,15,20,30,40,45,50); |
---|
| 26 | elt_hour_id string:${name}_hour; |
---|
| 27 | elt_minute_id string:${name}_minute"> |
---|
| 28 | <tal:block i18n:translate="cpsschema_at">at</tal:block> |
---|
| 29 | <select tal:attributes="name elt_hour_id; |
---|
| 30 | id elt_hour_id"> |
---|
| 31 | <tal:block repeat="h hours"> |
---|
| 32 | <option tal:attributes="value h; selected python:int(hour)==h" |
---|
| 33 | tal:content="python:'%2.2i'%h" /> |
---|
| 34 | </tal:block> |
---|
| 35 | </select> |
---|
| 36 | <label tal:attributes="for elt_hour_id" |
---|
| 37 | i18n:translate="cpsschema_hour">h</label> |
---|
| 38 | <select tal:attributes="name elt_minute_id; |
---|
| 39 | id elt_minute_id"> |
---|
| 40 | <tal:block repeat="m minutes"> |
---|
| 41 | <option tal:attributes="value m; selected python:int(minute)==m" |
---|
| 42 | tal:content="python:'%2.2i'%m" /> |
---|
| 43 | </tal:block> |
---|
| 44 | <tal:block condition="python:int(minute) not in minutes"> |
---|
| 45 | <option tal:attributes="value minute" tal:content="minute" |
---|
| 46 | selected="selected" /> |
---|
| 47 | </tal:block> |
---|
| 48 | </select> |
---|
| 49 | <label tal:attributes="for elt_minute_id" |
---|
| 50 | i18n:translate="cpsschema_minute">mn</label> |
---|
| 51 | </tal:block> |
---|
| 52 | </tal:block> |
---|
| 53 | </tal:block> |
---|