loops/browser/relation_macros.pt
helmutm ae534d7bfc provide editing of relation properties (order, relevance) in management interface
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3955 fd906abe-77d9-0310-91a1-e0d9ade77398
2010-08-15 09:25:42 +00:00

230 lines
8.8 KiB
XML

<html i18n:domain="loops">
<metal:assignments define-macro="listing"
tal:define="editable request/edit_relations|nothing">
<script type="text/javascript">
function toggleCheckBoxes(toggle, fieldName) {
var w = toggle.form[fieldName];
if (w[0] == null) w = [w];
for (i in w) w[i].checked=toggle.checked;
}
</script>
<fieldset>
<legend tal:content="legend"
i18n:translate=""
style="padding: 0 4px 0 4px">Listing</legend>
<metal:top define-slot="topActions" />
<form metal:define-macro="listing_form"
method="post" action="."
tal:define="formName formName|string:listing"
tal:attributes="action request/URL;
name formName"
tal:condition="items">
<input type="hidden" name="action" value="remove"
tal:attributes="value action" />
<input type="hidden" name="qualifier" value="parents"
tal:condition="qualifier"
tal:attributes="value qualifier" />
<table class="listing" summary="Currently assigned objects"
i18n:attributes="summary"
tal:attributes="summary summary">
<thead>
<tr>
<th style="padding: 0">
<input type="checkbox"
onclick="toggleCheckBoxes(this, 'tokens:list')" /></th>
<th i18n:translate="label_title">Title</th>
<th i18n:translate="label_type">Type</th>
<tal:relation condition="showPredicate">
<th i18n:translate="label_predicate">Predicate</th>
<th i18n:translate="label_order">Ord</th>
<th i18n:translate="label_relevance">RF</th>
</tal:relation>
</tr>
</thead>
<tbody>
<tr tal:repeat="item items">
<td class="field">
<input class="formSelection"
type="checkbox" name="tokens:list" value=""
xxtal:condition="not:item/isProtected|nothing"
tal:attributes="value item/token" />
</td>
<td>
<a tal:content="item/title"
tal:attributes="href string:${item/url}/@@SelectedManagementView.html">
Title
</a>
</td>
<td>
<a tal:condition="item/typeTitle | nothing"
tal:content="item/typeTitle" href="#"
tal:omit-tag="not:item/typeUrl"
tal:attributes="href
string:${item/typeUrl}/@@SelectedManagementView.html">
Type
</a>
</td>
<tal:relation condition="showPredicate">
<td>
<a tal:content="item/predicateTitle" href="#"
tal:attributes="href
string:${item/predicateUrl}/@@SelectedManagementView.html">
Predicate
</a>
</td>
<td style="text-align: center">
<span tal:condition="not:editable"
tal:content="item/order" />
<input size="1"
tal:attributes="value item/order;
name string:order.${item/token}"
tal:condition="editable" />
</td>
<td style="text-align: center">
<span tal:condition="not:editable"
tal:content="item/relevance" />
<input size="1"
tal:attributes="value item/relevance;
name string:relevance.${item/token}"
tal:condition="editable" />
</td>
</tal:relation>
</tr>
</tbody>
</table>
<div class="formControls">
<input class="context" type="submit" name="form.button.submit"
i18n:attributes="value"
tal:attributes="value buttonText" />
<metal:buttons define-slot="specialButtons" />
<tal:change condition="python: showPredicate and editable">
&nbsp;&nbsp;
<input class="context" type="submit" name="form.button.change_relations"
value="Change Relations"
i18n:attributes="value" />
</tal:change>
</div>
</form>
</fieldset>
</metal:assignments>
<metal:create define-macro="create">
<fieldset>
<legend tal:content="legend"
i18n:translate=""
style="padding: 0 4px 0 4px">Create Object</legend>
<form method="post" name="listing" action="."
tal:attributes="action request/URL">
<input type="hidden" name="action" value="create" />
<div class="row">
<span i18n:translate="">Name</span>
<input name="create.name" size="15"
tal:attributes="value nothing" />&nbsp;
<span i18n:translate="">Title</span>
<input name="create.title" size="30"
tal:attributes="value nothing" />&nbsp;
<span i18n:translate="">Type</span>
<select name="create.type" metal:define-slot="types">
<tal:types repeat="type view/conceptTypes">
<option value=".loops/concepts/topic"
i18n:translate=""
tal:attributes="value type/token"
tal:content="type/title">Topic</option>
</tal:types>
</select>
</div><br />
<div class="formControls">
<metal:control define-slot="control">
<input class="context" type="submit" name="form.button.submit"
value="Create Object"
i18n:attributes="value"
tal:attributes="value buttonText" />
and assign as
<select name="assignAs">
<option value="child" selected i18n:translate="">Child</option>
<option value="parent" i18n:translate="">Parent</option>
</select>
using Predicate
<select name="create.predicate" metal:define-macro="predicates">
<tal:types repeat="pred view/predicates">
<option value=".loops/concepts/hasType"
i18n:translate=""
tal:attributes="value pred/token"
tal:content="pred/title">Predicate</option>
</tal:types>
</select>
</metal:control>
<span i18n:translate="">Order</span>
<input name="create.order" size="2" value="0" />&nbsp;
<span i18n:translate="">Relevance</span>
<input name="create.relevance" size="3" value="1.0" />&nbsp;
</div>
</form>
</fieldset>
</metal:create>
<metal:search define-macro="search">
<form method="post" name="listing" action="."
tal:attributes="action request/URL">
<input type="hidden" name="action" value="search" />
<div class="row"
tal:define="searchTerm request/searchTerm | nothing;
searchType request/searchType | nothing;">
<span i18n:translate="">Search Term</span>
<input name="searchTerm"
tal:attributes="value searchTerm" />
<span i18n:translate="">Type</span>
<select name="searchType" metal:define-slot="types">
<tal:types repeat="type view/conceptTypesForSearch">
<option value=".loops/concepts/topic"
i18n:translate=""
tal:attributes="value type/token;
selected python: type.token == searchType"
tal:content="type/title">Topic</option>
</tal:types>
<option value="none"
tal:attributes="selected python:
searchType == 'none'">None</option>
</select>
</div>
<div class="formControls">
<input class="context" type="submit" name="form.button.submit"
value="Search"
i18n:attributes="value" />
</div>
</form>
</metal:search>
<metal:clients define-macro="clients">
<div tal:define="items view/clients">
<fieldset>
<legend i18n:translate=""
style="padding: 0 4px 0 4px">Clients</legend>
<table class="listing" summary="Clients" i18n:attributes="summary">
<thead>
<tr>
<th i18n:translate="label_title">Title</th>
<th i18n:translate="label_type">Type</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="item items">
<td><a tal:content="item/title" href="#"
tal:attributes="href
string:${item/url}/@@configure.html">
Title</a></td>
<td tal:content="item/nodeType">Type</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</metal:clients>
</html>