[478] | 1 | <!-- a layout_lib macro --> |
---|
[486] | 2 | <!-- $Id: layout_application_edit.pt 493 2006-09-08 06:55:42Z henrik $ --> |
---|
[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; |
---|
| 14 | "> |
---|
[478] | 15 | |
---|
[486] | 16 | <form action="" id="editForm" method="post" |
---|
| 17 | enctype="multipart/form-data" class="workflow" |
---|
| 18 | tal:attributes="action formaction" |
---|
[492] | 19 | |
---|
[486] | 20 | > |
---|
[493] | 21 | <table width="" cellpadding="2" cellspacing="0" summary="Form layout" |
---|
[486] | 22 | tal:condition="layout/rows"> |
---|
[492] | 23 | <tr tal:repeat="row layout/rows" valign="top" > |
---|
| 24 | <span tal:repeat="cell row" |
---|
[486] | 25 | tal:attributes="colspan cell/ncols"> |
---|
| 26 | <tal:block define="widget cell/widget; |
---|
[492] | 27 | wid widget/getWidgetId; |
---|
| 28 | err python:ds.getError(wid); |
---|
| 29 | err_mapping python:ds.getErrorMapping(wid); |
---|
| 30 | is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes); |
---|
| 31 | tooltip_id python:wid + '_help'; |
---|
| 32 | widget_css_class cell/widget_css_class|nothing; |
---|
| 33 | css_class python:test(err, 'row error','row')" |
---|
| 34 | > |
---|
[486] | 35 | <div tal:attributes="class widget_css_class; |
---|
| 36 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
| 37 | > |
---|
[492] | 38 | <td> |
---|
[486] | 39 | <div class="label" tal:condition="widget/label_edit" |
---|
| 40 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
| 41 | <label tal:content="widget/label_edit" |
---|
[492] | 42 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label>: |
---|
[486] | 43 | </div> |
---|
| 44 | <button type="button" class="tooltipControl" |
---|
| 45 | tal:condition="widget/help" |
---|
| 46 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
[492] | 47 | </td> |
---|
| 48 | <td> |
---|
| 49 | <span class="field"> |
---|
[486] | 50 | <div tal:replace="structure cell/widget_rendered"/> |
---|
[492] | 51 | </span> |
---|
[486] | 52 | <div class="tooltipArea" style="visibility: hidden;" |
---|
| 53 | tal:condition="widget/help" |
---|
| 54 | tal:attributes="id tooltip_id; |
---|
| 55 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
| 56 | > |
---|
| 57 | <tal:block tal:content="widget/help">This is the help for this field |
---|
| 58 | </tal:block> |
---|
| 59 | </div> |
---|
| 60 | <tal:block condition="err"> |
---|
[478] | 61 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
| 62 | <br /><em style="color: red" |
---|
[486] | 63 | tal:content="msg">err</em> |
---|
[478] | 64 | </tal:block> |
---|
[486] | 65 | </tal:block> |
---|
[492] | 66 | </td> |
---|
[478] | 67 | </div> |
---|
[486] | 68 | </tal:block> |
---|
[492] | 69 | </span> |
---|
[486] | 70 | </tr> |
---|
| 71 | </table> |
---|
[492] | 72 | <br /> |
---|
[478] | 73 | <input type="submit" class="standalone" name="cpsdocument_edit_button" |
---|
| 74 | value="button_change" i18n:attributes="value" id="cpsdocument_edit_button" |
---|
| 75 | tal:condition="not:creation" /> |
---|
| 76 | <input type="submit" class="standalone" name="cpsdocument_edit_and_view_button" |
---|
| 77 | value="button_change_and_view" i18n:attributes="value" |
---|
| 78 | id="cpsdocument_edit_and_view_button" |
---|
[482] | 79 | tal:condition="python:0 and not creation" /> |
---|
[481] | 80 | <input type="submit" |
---|
| 81 | class="standalone" |
---|
| 82 | name="cpsdocument_create_button" |
---|
| 83 | value="apply" |
---|
| 84 | i18n:attributes="value" tal:condition="creation" /> |
---|
[478] | 85 | |
---|
[492] | 86 | </form> |
---|
| 87 | |
---|
| 88 | |
---|
[478] | 89 | </metal:block> |
---|
[492] | 90 | |
---|
| 91 | |
---|