cybertools/composer/schema/browser/schema_macros.pt
helmutm 31bddf189d renamed 'schemaMacros' attribute to 'fieldRenderers'; start with adapter-based registration of renderers (=macros for standard browser UIs)
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2088 fd906abe-77d9-0310-91a1-e0d9ade77398
2007-10-07 13:15:00 +00:00

141 lines
4.7 KiB
XML
Executable file

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
i18n:domain="loops">
<body>
<metal:fields define-macro="fields">
<tal:define define="manageMode manageMode|view/manageMode|nothing;
fields view/fields;
data view/data">
<table style="width: 100%">
<tal:fields repeat="field fields">
<tal:field define="name field/name;
errors state/fieldInstances/?name/errors|python: [];">
<metal:field use-macro="python: view.fieldRenderers[field.fieldRenderer]" />
</tal:field>
</tal:fields>
</table>
<tal:add condition="manageMode">
<metal:add use-macro="view/fieldEditRenderers/add_buttons" />
</tal:add>
</tal:define>
</metal:fields>
<metal:field define-macro="field">
<tbody tal:omit-tag="not:errors"
class="error"
style="padding: 4px; margin-bottom: 4px;">
<tal:errors repeat="error errors">
<tr>
<td colspan="2" style="padding: 4px"
i18n:translate=""
tal:content="error/description">???</td>
</tr>
</tal:errors>
<tr>
<tal:field>
<td style="padding: 4px; border-top: none"
tal:attributes="title field/description">
<b tal:content="field/title">...</b>
<span tal:condition="field/required">*</span>
</td>
<td class="field" style="border-top: none">
<metal:input use-macro="python:
view.fieldRenderers[field.inputRenderer]" />
</td>
</tal:field>
</tr>
<tr style="border-bottom: 1px solid #dddddd"
tal:condition="manageMode">
<td style="border-top: none">
<metal:move use-macro="view/fieldEditRenderers/move_icons" />
</td>
<td style="border-top: none">
<metal:edit use-macro="view/fieldEditRenderers/edit_buttons" />
</td>
</tr>
</tbody>
</metal:field>
<metal:textline define-macro="input_textline">
<input type="text" name="field" style="width: 450px"
tal:define="width field/width|nothing"
tal:attributes="name name;
style python:
'width: %s' % (width and str(width)+'px' or '450px');
value data/?name" />
</metal:textline>
<metal:password define-macro="input_password">
<input type="password" name="field" style="width: 450px"
tal:define="width field/width|nothing"
tal:attributes="name name;
style python:
'width: %s' % (width and str(width)+'px' or '450px');
value data/?name" />
</metal:password>
<metal:textarea define-macro="input_textarea">
<textarea name="field" rows="3" style="width: 450px"
tal:define="width field/width|nothing;
height field/height|python:3"
tal:attributes="name name;
rows python: height or 3;
style python:
'width: %s' % (width and str(width)+'px' or '450px');"
tal:content="data/?name">
</textarea>
</metal:textarea>
<metal:upload define-macro="input_fileupload">
<input type="file" name="field"
tal:attributes="name name;" />
</metal:upload>
<metal:dropdown define-macro="input_dropdown">
<select name="field" style="width: auto"
tal:define="width field/width|nothing"
tal:attributes="name name;
style python:
'width: %s' % (width and str(width)+'px' or '');">
<option tal:repeat="item field/getVocabularyItems"
tal:content="item/title"
tal:attributes="value item/token;
selected python:
item['token'] == data[name]">Mrs</option>
</select>
</metal:dropdown>
<metal:spacer define-macro="field_spacer">
<tr>
<td colspan="2" style="border-top:none; font-size: 50%">&nbsp;</td>
</tr>
<tr>
<td colspan="2"
style="border-top: 1px solid #bbbbbb; padding: 8px 4px;
margin-top: 10px;">
<div><b tal:content="field/title"></b></div>
<div tal:content="structure field/description"></div>
</td>
</tr>
<tr style="border-bottom: 1px solid #dddddd"
tal:condition="manageMode">
<td style="border-top: none">
<metal:move use-macro="view/fieldEditRenderers/move_icons" />
</td>
<td style="border-top: none">
<metal:edit use-macro="view/fieldEditRenderers/edit_buttons" />
</td>
</tr>
</metal:spacer>
</body>
</html>