source: WAeUP_SRP/trunk/skins/waeup_custom/widget_boolean_render.pt @ 1212

Last change on this file since 1212 was 1208, checked in by joachim, 18 years ago

fix for slow boolean_rendering

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1<tal:block define="mode options/mode;
2                   value options/value;
3                   label_value options/label_value;
4                   render_format options/render_format">
5
6<tal:block condition="python:mode == 'view'">
7  <tal:block content="label_value"/>
8</tal:block>
9
10<tal:block condition="python:mode == 'edit'">
11  <tal:block define="true_checked value;
12    ">
13    <tal:checkbox condition="python:render_format == 'checkbox'">
14      <input type="checkbox" value="True"
15             tal:attributes="checked true_checked;
16                             name string:${here/getHtmlWidgetId}:boolean;
17                             id string:${here/getHtmlWidgetId};
18              "/>
19      <input type="hidden" value=""
20             tal:attributes="name string:${here/getHtmlWidgetId}:boolean:default;" />
21    </tal:checkbox>
22
23    <tal:radio condition="python:render_format == 'radio'">
24      <fieldset class="widget"
25                tal:attributes="id string:${here/getHtmlWidgetId}">
26      <input type="radio" value="True"
27             tal:attributes="checked true_checked;
28                             id string:${here/getHtmlWidgetId}_true;
29                             name string:${here/getHtmlWidgetId}:boolean;" />
30      <label tal:content="here/label_true"
31             tal:attributes="for string:${here/getHtmlWidgetId}_true"
32             i18n:translate="" > True </label><br/>
33      <input type="radio" value="False"
34             tal:attributes="checked not:true_checked;
35                             id string:${here/getHtmlWidgetId}_false;
36                             name string:${here/getHtmlWidgetId}:boolean;" />
37      <label tal:content="here/label_false"
38             tal:attributes="for string:${here/getHtmlWidgetId}_false"
39             i18n:translate="" > False </label><br/>
40      </fieldset>
41    </tal:radio>
42
43    <tal:select condition="python:render_format == 'select'">
44      <select tal:attributes="
45              name string:${here/getHtmlWidgetId}:boolean;
46              id string:${here/getHtmlWidgetId};
47          ">
48        <option value="True"
49                tal:attributes="selected true_checked"
50                tal:content="here/label_true"
51                i18n:translate="" />
52        <option value="False"
53                tal:attributes="selected not:true_checked"
54                tal:content="here/label_false"
55                i18n:translate="" />
56      </select>
57    </tal:select>
58
59  </tal:block>
60
61</tal:block>
62
63</tal:block>
Note: See TracBrowser for help on using the repository browser.