1 | <metal:block define-macro="default_edit" |
---|
2 | tal:define="layout options/layout; |
---|
3 | ds options/datastructure; |
---|
4 | dm ds/getDataModel; |
---|
5 | formaction options/formaction|string:application_edit; |
---|
6 | creation creation|nothing; |
---|
7 | cpsmcat nocall:here/translation_service; |
---|
8 | proceed options/proceed|nothing; |
---|
9 | widgets python:context.getRenderedWidgets(layout); |
---|
10 | "> |
---|
11 | <table class="layoutDefault" summary="Form layout" |
---|
12 | tal:condition="layout/rows"> |
---|
13 | <span tal:repeat="row python: layout['rows']" valign="top" > |
---|
14 | <span tal:repeat="cell row"> |
---|
15 | <tr tal:define="widget cell/widget; |
---|
16 | wid widget/getWidgetId; |
---|
17 | err python:ds.getError(wid); |
---|
18 | err_mapping python:ds.getErrorMapping(wid); |
---|
19 | is_required python: widget.is_required; |
---|
20 | tooltip_id python:wid + '_help'; |
---|
21 | widget_css_class cell/widget_css_class|nothing; |
---|
22 | css_class python:test(err, 'row error','row')" |
---|
23 | tal:condition="python: wid != 'passport'" |
---|
24 | > |
---|
25 | <div tal:attributes="class widget_css_class; |
---|
26 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
27 | > |
---|
28 | <td> |
---|
29 | <div class="label" tal:condition="widget/label_edit" |
---|
30 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
31 | <label tal:content="widget/label_edit" |
---|
32 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label>: |
---|
33 | </div> |
---|
34 | <button type="button" class="tooltipControl" |
---|
35 | tal:condition="widget/help" |
---|
36 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
37 | </td> |
---|
38 | <td> |
---|
39 | <span class="field"> |
---|
40 | <div tal:replace="structure cell/widget_rendered"/> |
---|
41 | </span> |
---|
42 | <div class="tooltipArea" style="visibility: hidden;" |
---|
43 | tal:condition="widget/help" |
---|
44 | tal:attributes="id tooltip_id; |
---|
45 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
46 | > |
---|
47 | <tal:block tal:content="widget/help">This is the help for this field |
---|
48 | </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 | </td> |
---|
57 | </div> |
---|
58 | </tr> |
---|
59 | </span> |
---|
60 | </span> |
---|
61 | <tr tal:condition="widgets/passport|nothing" |
---|
62 | tal:define="cell widgets/passport|nothing;"> |
---|
63 | <tal:block tal:define="widget cell/widget; |
---|
64 | wid widget/getWidgetId; |
---|
65 | err python:ds.getError(wid); |
---|
66 | err_mapping python:ds.getErrorMapping(wid); |
---|
67 | is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes); |
---|
68 | tooltip_id python:wid + '_help'; |
---|
69 | widget_css_class widget/widget_css_class|nothing; |
---|
70 | css_class python:test(err, 'row error','row')" |
---|
71 | > |
---|
72 | <div tal:attributes="class widget_css_class; |
---|
73 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
74 | > |
---|
75 | <td> |
---|
76 | <div class="label" tal:condition="widget/label_edit" |
---|
77 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
78 | <label tal:content="widget/label_edit" |
---|
79 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label>: |
---|
80 | </div> |
---|
81 | <button type="button" class="tooltipControl" |
---|
82 | tal:condition="widget/help" |
---|
83 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
84 | </td> |
---|
85 | <td> |
---|
86 | <span class="field"> |
---|
87 | <div tal:replace="structure cell/widget_rendered"/> |
---|
88 | </span> |
---|
89 | <div class="tooltipArea" style="visibility: hidden;" |
---|
90 | tal:condition="widget/help" |
---|
91 | tal:attributes="id tooltip_id; |
---|
92 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
93 | > |
---|
94 | <tal:block tal:content="widget/help">This is the help for this field |
---|
95 | </tal:block> |
---|
96 | </div> |
---|
97 | <tal:block condition="err"> |
---|
98 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
99 | <br /><em style="color: red" |
---|
100 | tal:content="msg">err</em> |
---|
101 | </tal:block> |
---|
102 | </tal:block> |
---|
103 | </td> |
---|
104 | </div> |
---|
105 | </tal:block> |
---|
106 | </tr> |
---|
107 | </table> |
---|
108 | </metal:block> |
---|