1 | <tal:block define="global creation python:0; |
---|
2 | global formaction string:set_access_data" /> |
---|
3 | <!-- a layout_lib macro --> |
---|
4 | <!-- $Id: layout_wo_object_edit.pt 1393 2007-02-05 21:42:08Z joachim $ --> |
---|
5 | |
---|
6 | <metal:block define-macro="default_edit" |
---|
7 | tal:define="layout options/layout; |
---|
8 | ds options/datastructure; |
---|
9 | dm ds/getDataModel; |
---|
10 | cpsmcat nocall:here/translation_service; |
---|
11 | "> |
---|
12 | <table class="layoutDefault" summary="Form layout" |
---|
13 | tal:condition="layout/rows"> |
---|
14 | <span tal:repeat="row python: layout['rows']" valign="top" > |
---|
15 | <span tal:repeat="cell row"> |
---|
16 | <tr tal:define="widget cell/widget; |
---|
17 | wid widget/getWidgetId; |
---|
18 | err python:ds.getError(wid); |
---|
19 | err_mapping python:ds.getErrorMapping(wid); |
---|
20 | is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes); |
---|
21 | tooltip_id python:wid + '_help'; |
---|
22 | widget_css_class cell/widget_css_class|nothing; |
---|
23 | css_class python:test(err, 'row error','row')" |
---|
24 | tal:condition="python: wid != 'passport'" |
---|
25 | > |
---|
26 | <div tal:attributes="class widget_css_class; |
---|
27 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
28 | > |
---|
29 | <td> |
---|
30 | <div class="label" tal:condition="widget/label_edit" |
---|
31 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
32 | <label 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 | </td> |
---|
39 | <td> |
---|
40 | <span class="field"> |
---|
41 | <div tal:replace="structure cell/widget_rendered"/> |
---|
42 | </span> |
---|
43 | <div class="tooltipArea" style="visibility: hidden;" |
---|
44 | tal:condition="widget/help" |
---|
45 | tal:attributes="id tooltip_id; |
---|
46 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
47 | > |
---|
48 | <tal:block tal:content="widget/help">This is the help for this field |
---|
49 | </tal:block> |
---|
50 | </div> |
---|
51 | <tal:block condition="err"> |
---|
52 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
53 | <br /><em style="color: red" |
---|
54 | tal:content="msg">err</em> |
---|
55 | </tal:block> |
---|
56 | </tal:block> |
---|
57 | </td> |
---|
58 | </div> |
---|
59 | </tr> |
---|
60 | </span> |
---|
61 | </span> |
---|
62 | </table> |
---|
63 | </metal:block> |
---|