1 | <metal:block define-macro="default_edit" |
---|
2 | tal:define="layout options/layout; |
---|
3 | ds options/datastructure; |
---|
4 | dm ds/getDataModel; |
---|
5 | creation creation|nothing; |
---|
6 | cpsmcat nocall:here/translation_service; |
---|
7 | proceed options/proceed|nothing; |
---|
8 | "> |
---|
9 | <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout" |
---|
10 | tal:condition="layout/rows"> |
---|
11 | <tr tal:repeat="row layout/rows" valign="top"> |
---|
12 | <td tal:repeat="cell row" |
---|
13 | tal:attributes="colspan cell/ncols"> |
---|
14 | <tal:block define="widget cell/widget; |
---|
15 | wid widget/getWidgetId; |
---|
16 | err python:ds.getError(wid); |
---|
17 | err_mapping python:ds.getErrorMapping(wid); |
---|
18 | is_required widget/is_required|nothing; |
---|
19 | tooltip_id python:wid + '_help'; |
---|
20 | widget_css_class cell/widget_css_class|nothing; |
---|
21 | css_class python:test(err, 'row error','row')"> |
---|
22 | <div tal:attributes="class widget_css_class; |
---|
23 | id python:widget.getHtmlWidgetId()+'_widget'; |
---|
24 | "> |
---|
25 | <div class="label" tal:condition="widget/label_edit" |
---|
26 | tal:attributes="class python:test(is_required, 'label required', |
---|
27 | 'label')"> |
---|
28 | <label i18n:translate="" tal:condition="widget/is_i18n" |
---|
29 | tal:content="widget/label_edit" |
---|
30 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label> |
---|
31 | <label tal:condition="not:widget/is_i18n" |
---|
32 | tal:content="widget/label_edit" |
---|
33 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label> |
---|
34 | </div> |
---|
35 | <button type="button" class="tooltipControl" |
---|
36 | tal:condition="widget/help" |
---|
37 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
38 | <div class="field"> |
---|
39 | <div tal:replace="structure cell/widget_rendered"/> |
---|
40 | </div> |
---|
41 | <div class="tooltipArea" style="visibility: hidden;" |
---|
42 | tal:condition="widget/help" |
---|
43 | tal:attributes="id tooltip_id; |
---|
44 | onclick python:'showElement(false, \'%s\')' % tooltip_id;"> |
---|
45 | <tal:block i18n:translate="" tal:condition="widget/is_i18n" |
---|
46 | tal:content="widget/help">i18_key-help_for_this_field</tal:block> |
---|
47 | <tal:block tal:condition="not:widget/is_i18n" |
---|
48 | tal:content="widget/help">This is the help for this field</tal:block> |
---|
49 | </div> |
---|
50 | <tal:block condition="err"> |
---|
51 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
52 | <br /><em style="color: red" |
---|
53 | tal:content="msg">err</em> |
---|
54 | </tal:block> |
---|
55 | </tal:block> |
---|
56 | </div> |
---|
57 | </tal:block> |
---|
58 | </td> |
---|
59 | </tr> |
---|
60 | </table> |
---|
61 | </metal:block> |
---|