[478] | 1 | <!-- a layout_lib macro --> |
---|
[486] | 2 | <!-- $Id: layout_application_edit.pt 537 2006-09-20 06:40:54Z joachim $ --> |
---|
[492] | 3 | |
---|
[478] | 4 | <metal:block define-macro="default_edit" |
---|
| 5 | tal:define="layout options/layout; |
---|
[486] | 6 | ds options/datastructure; |
---|
| 7 | dm ds/getDataModel; |
---|
| 8 | formaction formaction|string:student_edit; |
---|
| 9 | creation creation|nothing; |
---|
| 10 | metadata metadata|nothing; |
---|
| 11 | type_name request/type_name|nothing; |
---|
| 12 | ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None); |
---|
| 13 | cpsmcat nocall:here/translation_service; |
---|
[535] | 14 | apply request/apply_button|nothing; |
---|
[537] | 15 | widgets python:context.getRenderedWidgets(layout); |
---|
[486] | 16 | "> |
---|
[537] | 17 | <span tal:condition="python: 0" tal:replace="structure widgets" /> |
---|
[486] | 18 | <form action="" id="editForm" method="post" |
---|
| 19 | enctype="multipart/form-data" class="workflow" |
---|
| 20 | tal:attributes="action formaction" |
---|
[492] | 21 | |
---|
[486] | 22 | > |
---|
[537] | 23 | <table class="layoutDefault" summary="Form layout" |
---|
[486] | 24 | tal:condition="layout/rows"> |
---|
[537] | 25 | <span tal:repeat="row python: layout['rows']" valign="top" > |
---|
| 26 | <span tal:repeat="cell row"> |
---|
| 27 | <tr tal:define="widget cell/widget; |
---|
[492] | 28 | wid widget/getWidgetId; |
---|
| 29 | err python:ds.getError(wid); |
---|
| 30 | err_mapping python:ds.getErrorMapping(wid); |
---|
| 31 | is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes); |
---|
| 32 | tooltip_id python:wid + '_help'; |
---|
| 33 | widget_css_class cell/widget_css_class|nothing; |
---|
| 34 | css_class python:test(err, 'row error','row')" |
---|
[537] | 35 | tal:condition="python: wid != 'passport'" |
---|
[492] | 36 | > |
---|
[486] | 37 | <div tal:attributes="class widget_css_class; |
---|
| 38 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
| 39 | > |
---|
[492] | 40 | <td> |
---|
[486] | 41 | <div class="label" tal:condition="widget/label_edit" |
---|
| 42 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
| 43 | <label tal:content="widget/label_edit" |
---|
[492] | 44 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label>: |
---|
[486] | 45 | </div> |
---|
| 46 | <button type="button" class="tooltipControl" |
---|
| 47 | tal:condition="widget/help" |
---|
| 48 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
[492] | 49 | </td> |
---|
| 50 | <td> |
---|
| 51 | <span class="field"> |
---|
[486] | 52 | <div tal:replace="structure cell/widget_rendered"/> |
---|
[492] | 53 | </span> |
---|
[486] | 54 | <div class="tooltipArea" style="visibility: hidden;" |
---|
| 55 | tal:condition="widget/help" |
---|
| 56 | tal:attributes="id tooltip_id; |
---|
| 57 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
| 58 | > |
---|
| 59 | <tal:block tal:content="widget/help">This is the help for this field |
---|
| 60 | </tal:block> |
---|
| 61 | </div> |
---|
| 62 | <tal:block condition="err"> |
---|
[478] | 63 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
| 64 | <br /><em style="color: red" |
---|
[486] | 65 | tal:content="msg">err</em> |
---|
[478] | 66 | </tal:block> |
---|
[486] | 67 | </tal:block> |
---|
[492] | 68 | </td> |
---|
[478] | 69 | </div> |
---|
[537] | 70 | </tr> |
---|
| 71 | </span> |
---|
| 72 | </span> |
---|
| 73 | <tr tal:condition="widgets/passport|nothing" tal:define="cell widgets/passport|nothing;"> |
---|
| 74 | <tal:block tal:define="widget cell/widget; |
---|
| 75 | wid widget/getWidgetId; |
---|
| 76 | err python:ds.getError(wid); |
---|
| 77 | err_mapping python:ds.getErrorMapping(wid); |
---|
| 78 | is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes); |
---|
| 79 | tooltip_id python:wid + '_help'; |
---|
| 80 | widget_css_class widget/widget_css_class|nothing; |
---|
| 81 | css_class python:test(err, 'row error','row')" |
---|
| 82 | > |
---|
| 83 | <div tal:attributes="class widget_css_class; |
---|
| 84 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
| 85 | > |
---|
| 86 | <td> |
---|
| 87 | <div class="label" tal:condition="widget/label_edit" |
---|
| 88 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
| 89 | <label tal:content="widget/label_edit" |
---|
| 90 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label>: |
---|
| 91 | </div> |
---|
| 92 | <button type="button" class="tooltipControl" |
---|
| 93 | tal:condition="widget/help" |
---|
| 94 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
| 95 | </td> |
---|
| 96 | <td> |
---|
| 97 | <span class="field"> |
---|
| 98 | <div tal:replace="structure cell/widget_rendered"/> |
---|
| 99 | </span> |
---|
| 100 | <div class="tooltipArea" style="visibility: hidden;" |
---|
| 101 | tal:condition="widget/help" |
---|
| 102 | tal:attributes="id tooltip_id; |
---|
| 103 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
| 104 | > |
---|
| 105 | <tal:block tal:content="widget/help">This is the help for this field |
---|
| 106 | </tal:block> |
---|
| 107 | </div> |
---|
| 108 | <tal:block condition="err"> |
---|
| 109 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
| 110 | <br /><em style="color: red" |
---|
| 111 | tal:content="msg">err</em> |
---|
| 112 | </tal:block> |
---|
| 113 | </tal:block> |
---|
| 114 | </td> |
---|
| 115 | </div> |
---|
| 116 | </tal:block> |
---|
| 117 | </tr> |
---|
| 118 | </table> |
---|
[492] | 119 | <br /> |
---|
[478] | 120 | <input type="submit" class="standalone" name="cpsdocument_edit_button" |
---|
[537] | 121 | value="Save" |
---|
[535] | 122 | id="cpsdocument_edit_button" |
---|
| 123 | tal:condition="not:creation" /> |
---|
| 124 | <input type="submit" class="standalone" name="apply_admission" |
---|
| 125 | value="apply for admission" |
---|
| 126 | id="cpsdocument_edit_and_view_button" |
---|
| 127 | tal:condition="apply" |
---|
| 128 | tal:attributes="value apply"/> |
---|
[481] | 129 | <input type="submit" |
---|
| 130 | class="standalone" |
---|
| 131 | name="cpsdocument_create_button" |
---|
[502] | 132 | value="apply" |
---|
| 133 | tal:attributes="value options/button" |
---|
| 134 | tal:condition="creation" /> |
---|
[478] | 135 | |
---|
[492] | 136 | </form> |
---|
[478] | 137 | </metal:block> |
---|