| 1 | <metal:block define-macro="edit"> |
|---|
| 2 | <tal:block define=" |
|---|
| 3 | layout options/layout; |
|---|
| 4 | ds options/datastructure; |
|---|
| 5 | creation creation|nothing; |
|---|
| 6 | formaction python: test(creation, 'member_create_form', |
|---|
| 7 | 'member_edit_form'); |
|---|
| 8 | "> |
|---|
| 9 | <div class="group"> |
|---|
| 10 | <form action="." method="post" name="form" enctype="multipart/form-data"> |
|---|
| 11 | <input type="hidden" name="dirname" value="." |
|---|
| 12 | tal:attributes="value request/dirname" /> |
|---|
| 13 | <input type="hidden" name="id" value="." |
|---|
| 14 | tal:attributes="value request/id|nothing" /> |
|---|
| 15 | <table cellpadding="0" cellspacing="2" summary="form layout" |
|---|
| 16 | tal:define="global has_edits nothing"> |
|---|
| 17 | <tr tal:repeat="row layout/rows"> |
|---|
| 18 | <tal:block repeat="cell row"> |
|---|
| 19 | <tal:block define="widget cell/widget; |
|---|
| 20 | wid widget/getWidgetId; |
|---|
| 21 | err python: ds.getError(wid); |
|---|
| 22 | is_edit python: cell['widget_mode'] == 'edit'; |
|---|
| 23 | is_required python: is_edit and widget.is_required; |
|---|
| 24 | global has_edits python: has_edits or is_edit; |
|---|
| 25 | tooltip_id python:wid + '_help'; |
|---|
| 26 | "> |
|---|
| 27 | <td align="right" valign="top"> |
|---|
| 28 | <div class="label" tal:condition="widget/label_edit" |
|---|
| 29 | tal:attributes="class python:is_required and 'label required' |
|---|
| 30 | or 'label'"> |
|---|
| 31 | <span i18n:translate="" tal:condition="widget/is_i18n" |
|---|
| 32 | tal:content="widget/label_edit">label</span> |
|---|
| 33 | <span tal:condition="not:widget/is_i18n" |
|---|
| 34 | tal:content="widget/label_edit">label</span> |
|---|
| 35 | <button type="button" class="tooltipControl" |
|---|
| 36 | tal:condition="widget/help" |
|---|
| 37 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
|---|
| 38 | </div> |
|---|
| 39 | </td> |
|---|
| 40 | <td valign="top" colspan="1" |
|---|
| 41 | tal:attributes="colspan python:cell['ncols']*2-1"> |
|---|
| 42 | <div tal:attributes="class python:err and 'error' or nothing"> |
|---|
| 43 | <div tal:attributes="class widget/css_class|nothing"> |
|---|
| 44 | <tal:block replace="structure cell/widget_rendered" /> |
|---|
| 45 | </div> |
|---|
| 46 | <div tal:condition="err"> |
|---|
| 47 | <em style="color:red" tal:content="err" |
|---|
| 48 | i18n:translate="">Error</em> |
|---|
| 49 | </div> |
|---|
| 50 | </div> |
|---|
| 51 | <div class="tooltipArea" style="visibility: hidden;" |
|---|
| 52 | tal:condition="widget/help" |
|---|
| 53 | tal:attributes="id tooltip_id; |
|---|
| 54 | onclick python:'showElement(false, \'%s\')' % tooltip_id;"> |
|---|
| 55 | <span i18n:translate="" tal:condition="widget/is_i18n" |
|---|
| 56 | tal:content="widget/help">i18_key-help_for_this_field</span> |
|---|
| 57 | <span tal:condition="not:widget/is_i18n" |
|---|
| 58 | tal:content="widget/help">This is the help for this field</span> |
|---|
| 59 | </div> |
|---|
| 60 | </td> |
|---|
| 61 | </tal:block> |
|---|
| 62 | </tal:block> |
|---|
| 63 | </tr> |
|---|
| 64 | <tr> |
|---|
| 65 | <td></td> |
|---|
| 66 | <td> |
|---|
| 67 | <tal:block condition="has_edits"> |
|---|
| 68 | <input type="submit" class="standalone" |
|---|
| 69 | name="member_edit_form:method" |
|---|
| 70 | value="button_change" i18n:attributes="value" |
|---|
| 71 | tal:condition="not:creation" /> |
|---|
| 72 | <input type="submit" class="standalone" |
|---|
| 73 | name="member_create_form:method" |
|---|
| 74 | value="button_create" i18n:attributes="value" |
|---|
| 75 | tal:condition="creation" /> |
|---|
| 76 | </tal:block> |
|---|
| 77 | </td> |
|---|
| 78 | </tr> |
|---|
| 79 | </table> |
|---|
| 80 | </form> |
|---|
| 81 | </div> |
|---|
| 82 | </tal:block> |
|---|
| 83 | </metal:block> |
|---|