
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1655 fd906abe-77d9-0310-91a1-e0d9ade77398
206 lines
7.7 KiB
XML
206 lines
7.7 KiB
XML
<!-- macros for rendering edit/create forms
|
|
$Id$ -->
|
|
|
|
<metal:block define-macro="edit">
|
|
<form method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="form.action" value="edit"
|
|
tal:attributes="value view/form_action" />
|
|
<input type="hidden" name="version"
|
|
tal:attributes="value request/version | nothing" />
|
|
<table cellpadding="3" class="form">
|
|
<tbody><tr><th colspan="5"><br />
|
|
<span tal:replace="view/title"
|
|
i18n:translate="">Edit Information Object
|
|
</span>
|
|
</th></tr></tbody>
|
|
|
|
<tbody><tr><td colspan="5">
|
|
<div id="form.fields">
|
|
<metal:fields use-macro="view/template/macros/fields" />
|
|
</div>
|
|
</td></tr></tbody>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td colspan="5" class="headline">Concept Assignments</td>
|
|
</tr>
|
|
<tr metal:use-macro="view/template/macros/assignments" />
|
|
<tr metal:use-macro="view/template/macros/search_concepts" />
|
|
<tr metal:use-macro="view/template/macros/versioning" />
|
|
<tr metal:use-macro="view/template/macros/buttons" />
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</metal:block>
|
|
|
|
|
|
<metal:block define-macro="create">
|
|
<form method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="form.action" value="create"
|
|
tal:attributes="value view/form_action" />
|
|
<table cellpadding="3" class="form">
|
|
<tbody><tr><th colspan="5"><br />
|
|
<span tal:replace="view/title"
|
|
i18n:translate="">Create Information Object</span>
|
|
<select name="form.type" id="form.type"
|
|
tal:attributes="onChange
|
|
string:return replaceFieldsNode(
|
|
'form.fields', 'form.type',
|
|
'${view/url}/inner_form.html')">
|
|
<option value=".loops/concepts/note"
|
|
tal:repeat="type view/resourceTypes"
|
|
tal:content="type/title"
|
|
tal:attributes="value type/token;
|
|
selected python:
|
|
type.token == (request.get('form.type')
|
|
or '.loops/concepts/note')">
|
|
Note
|
|
</option>
|
|
</select>
|
|
</th></tr></tbody>
|
|
|
|
<tbody><tr><td colspan="5">
|
|
<div id="form.fields">
|
|
<metal:fields use-macro="view/template/macros/fields" />
|
|
</div>
|
|
</td></tr></tbody>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td colspan="5" class="headline">Assign Concept(s)</td>
|
|
</tr>
|
|
<tr metal:use-macro="view/template/macros/assignments" />
|
|
<tr metal:use-macro="view/template/macros/search_concepts" />
|
|
<tr metal:use-macro="view/template/macros/buttons" />
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</metal:block>
|
|
|
|
|
|
<metal:fields define-macro="fields">
|
|
<tal:block tal:define="dummy view/setUp">
|
|
<table width="100%">
|
|
<tr tal:repeat="widget view/widgets">
|
|
<td class="label" width="10%"
|
|
tal:define="hint widget/hint">
|
|
<label tal:attributes="for widget/name">
|
|
<span class="required" tal:condition="widget/required"
|
|
>*</span><span i18n:translate=""
|
|
tal:content="widget/label">label</span>
|
|
</label>
|
|
</td>
|
|
<td class="field" colspan="4" width="90%"
|
|
tal:define="hint widget/hint">
|
|
<div class="widget" tal:content="structure widget">
|
|
<input type="text" />
|
|
</div>
|
|
<div class="error"
|
|
tal:condition="widget/error">
|
|
<span tal:replace="structure widget/error">error</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</tal:block>
|
|
</metal:fields>
|
|
|
|
|
|
<metal:assignments define-macro="assignments">
|
|
<tbody id="form.assignments">
|
|
<tr tal:repeat="type view/presetTypesForAssignment">
|
|
<td><span i18n:translate="">Type: </span></td>
|
|
<td><b tal:content="type/title" /></td>
|
|
<td><span i18n:translate="">Select value: </span></td>
|
|
<td colspan="2">
|
|
<select name="form.assignments.selected:list">
|
|
<tal:concepts repeat="concept python: view.conceptsForType(type['token'])">
|
|
<option tal:attributes="value concept/token"
|
|
tal:content="concept/title">Zope Corp</option>
|
|
</tal:concepts>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr tal:repeat="relation view/assignments">
|
|
<td colspan="5">
|
|
<input type="hidden" name="form.assignments.old:list"
|
|
tal:attributes="value relation/uidToken"
|
|
tal:condition="relation/other" />
|
|
<input type="checkbox" checked name="form.assignments.selected:list"
|
|
tal:attributes="value relation/uidToken;" />
|
|
<span tal:content="relation/title">Something</span>
|
|
(<span tal:content="relation/typeTitle">Topic</span>)
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</metal:assignments>
|
|
|
|
|
|
<tr metal:define-macro="search_concepts">
|
|
<td><label for="concept.search.type">Type:</label></td>
|
|
<td>
|
|
<select id="concept.search.type"
|
|
tal:attributes="onChange
|
|
string:setConceptTypeForComboBox(
|
|
'concept.search.type', 'concept.search.text')">
|
|
<tal:types repeat="type view/conceptTypesForSearch">
|
|
<option value="loops:*"
|
|
i18n:translate=""
|
|
tal:attributes="value type/token"
|
|
tal:content="type/title">Topic</option>
|
|
</tal:types>
|
|
</select>
|
|
</td>
|
|
<td><label for="concept.search.text">Search text:</label></td>
|
|
<td>
|
|
<input type="hidden"
|
|
id="concept.search.predicate"
|
|
tal:attributes="value view/defaultPredicateUid" />
|
|
<input dojoType="comboBox" mode="remote" autoComplete="False"
|
|
name="concept.search.text" id="concept.search.text"
|
|
tal:attributes="dataUrl
|
|
string:${context/@@absolute_url}/listConceptsForComboBox.js?searchString=%{searchString}&searchType=" />
|
|
</td>
|
|
<td>
|
|
<input type="button" value="Select"
|
|
onClick="addConceptAssignment()" />
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<metal:versioning define-macro="versioning"
|
|
tal:define="versionInfo view/versionInfo"
|
|
tal:condition="versionInfo">
|
|
<tr>
|
|
<td colspan="5" class="headline">Versioning</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
Version:
|
|
<span tal:content="versionInfo">1.1 (current, released)</span>
|
|
</td>
|
|
<td title="Select if you want to create a new version">
|
|
<input type="checkbox"
|
|
name="version.create" id="version.create"
|
|
value="create" />
|
|
<label for="version.create">New version:</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="version.level">
|
|
<option value="1">minor</option>
|
|
<option value="0">major</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</metal:versioning>
|
|
|
|
|
|
<tr metal:define-macro="buttons">
|
|
<td colspan="5"
|
|
tal:define="dlgName view/dialog_name">
|
|
<input type="submit" value="Save" onClick="dlg.hide()" class="submit"
|
|
tal:attributes="onClick string:dialogs['$dlgName'].hide()">
|
|
<input type="button" value="Cancel" onClick="dlg.hide();"
|
|
tal:attributes="onClick string:dialogs['$dlgName'].hide()">
|
|
</td>
|
|
</tr>
|