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