loops/browser/concept_macros.pt
2015-06-12 08:35:07 +02:00

382 lines
16 KiB
XML

<html i18n:domain="loops">
<metal:data define-macro="layout">
<tal:part repeat="part item/getParts">
<metal:part use-macro="part/macro" />
</tal:part>
</metal:data>
<metal:data define-macro="conceptdata">
<div tal:attributes="class string:content-$level;">
<metal:block use-macro="view/concept_macros/concepttitle" />
<metal:slot define-slot="fields">
<metal:block use-macro="view/concept_macros/conceptfields" />
</metal:slot>
<metal:slot define-slot="children">
<metal:block use-macro="view/concept_macros/conceptchildren" />
</metal:slot>
<metal:slot define-slot="resources">
<metal:block use-macro="view/concept_macros/conceptresources" />
</metal:slot>
<metal:slot define-slot="workitems">
<metal:block use-macro="view/work_macros/workitems" />
</metal:slot>
<metal:slot define-slot="querydata" />
<metal:block use-macro="view/comment_macros/comments" />
</div>
</metal:data>
<metal:selection define-macro="filter_input">
<div tal:define="criteria item/filterInput"
tal:condition="criteria">
<form method="get" name="filter" id="form-filter">
<span tal:repeat="crit criteria">
<metal:input use-macro="crit/macro" />
</span>
<input type="submit" name="show" value="Show"
tal:condition="nothing" />
</form>
</div>
</metal:selection>
<metal:title define-macro="concepttitle">
<metal:title define-macro="concepttitle_only">
<tal:actions condition="view/showObjectActions">
<div metal:use-macro="views/node_macros/object_actions" />
</tal:actions>
<h1 tal:define="tabview item/tabview|nothing"
tal:attributes="ondblclick item/openEditWindow">
<a tal:omit-tag="python: level > 1"
tal:attributes="href string:${request/URL}${item/urlParamString}"
tal:content="item/title">Title</a>
<a title="Show tabular view"
i18n:attributes="title"
tal:condition="tabview"
tal:attributes="href
string:${item/targetUrl}?loops.viewName=$tabview">
<img tal:attributes="src
string:$resourceBase/cybertools.icons/table.png" />
</a>
</h1>
<metal:block use-macro="view/concept_macros/filter_input" />
</metal:title>
<metal:desc define-macro="conceptdescription"
tal:define="description description|item/renderedDescription"
tal:condition="description">
<div class="description"
tal:content="structure description">Description</div>
</metal:desc>
</metal:title>
<metal:fields define-macro="conceptfields">
<fieldset class="box"
tal:define="data item/getData;
values python: [v for v in data.values() if v];
fields item/fields"
tal:condition="values">
<table class="fields"
tal:attributes="ondblclick item/openEditWindow">
<tal:row repeat="field fields">
<tr tal:define="fieldName field/name;
value nocall:data/?fieldName;
fieldInstance python:field.getFieldInstance(
context=context, request=request);
rendererName field/displayRenderer;
renderer python:
fieldInstance.getRenderer(rendererName) or
view.concept_macros[rendererName]"
tal:condition="python:value or field.showEmpty">
<td><b tal:content="field/title" i18n:translate="" />:</td>
<td><span metal:use-macro="renderer" /></td>
</tr>
</tal:row>
</table>
</fieldset>
</metal:fields>
<metal:textline define-macro="display_textline">
<span tal:content="structure nocall:value"></span>
</metal:textline>
<metal:textline define-macro="display_password">
<span>*****</span>
</metal:textline>
<metal:email define-macro="display_email">
<a tal:attributes="href string:mailto:$value"
tal:content="value"></a>
</metal:email>
<metal:parents define-macro="conceptparents">
<div tal:attributes="class string:content-$level;
ondblclick python: item.openEditWindow('configure.html')">
<h2 i18n:translate="">Parents</h2>
<div tal:repeat="related item/parents">
<a href="#"
tal:attributes="href python: view.getUrlForTarget(related)"
tal:content="related/title">Concept Title</a>
</div>
</div>
</metal:parents>
<metal:children define-macro="conceptchildren">
<div tal:attributes="class string:content-$level;
ondblclick python: item.openEditWindow('configure.html')"
tal:define="list_nested request/list_nested|nothing;
children children|python:list(item.unique(item.children()))"
tal:condition="children">
<h2 i18n:translate=""
tal:condition="show_headline|python:True">Children</h2>
<form method="post"
tal:omit-tag="not:item/editable">
<table class="listing"
metal:define-macro="children">
<tr>
<th tal:condition="item/showCheckboxes|nothing">&nbsp;</th>
<th i18n:translate="">Title</th>
<th class="center" i18n:translate="">Type</th>
<th i18n:translate="">Modification Date</th>
<th i18n:translate="">Author(s)</th>
<th i18n:translate=""
tal:condition="view/showObjectActions">Info</th>
</tr>
<tbody withHandles="true" id="children_list"
tal:attributes="dojoType python:
item.editable and 'dojo.dnd.Source' or ''">
<tal:items repeat="related children">
<tal:item define="class python:
repeat['related'].odd() and 'even' or 'odd';">
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
id related/uniqueId">
<td tal:condition="item/showCheckboxes|nothing"
tal:define="uid related/uniqueId"
class="checkbox">
<input type="checkbox" name="selection:list" checked
tal:attributes="value uid;" /></td>
<td valign="top">
<a tal:attributes="href python: view.getUrlForTarget(related);
title related/relationInfo">
<span tal:replace="related/title">Concept Title</span>
</a>
</td>
<td class="center"><span tal:content="related/typeTitle"
i18n:translate="">Type</span></td>
<td><span tal:replace="related/modified">2011-01-10</span></td>
<td tal:attributes="title related/creators">
<span tal:replace="related/lastCreator">Author</span></td>
<td class="nowrap"
tal:define="target nocall:related;
style nothing"
tal:condition="view/showObjectActions">
<div metal:use-macro="views/node_macros/object_actions" />
<input type="hidden" name="child_tokens:list"
tal:attributes="value related/uidToken" />
</td>
</tr>
<tr tal:define="children python:list(related.unique(related.children()));
resources python:list(related.resources())"
tal:condition="python:list_nested and (children or resources)">
<td tal:condition="item/showCheckboxes|nothing" />
<td colspan="5">
<metal:list use-macro="item/template/macros/list_nested" />
</td>
</tr>
</tal:item>
</tal:items>
</tbody>
</table>
<input type="hidden" name="loops.viewName" value="index.html" />
<tal:changeorder condition="item/editable">
<input type="submit" style="display: none"
name="children_change_order" id="children_change_order"
value="Save Changes"
i18n:attributes="value" />
<script language="javascript">
dojo.subscribe('/dnd/drop', function(data) {
if (data.node.id == 'children_list') {
dojo.byId('children_change_order').style.display = ''}});
</script>
</tal:changeorder>
</form>
</div>
</metal:children>
<metal:resources define-macro="conceptresources">
<div tal:attributes="class string:content-$level;
ondblclick python: item.openEditWindow('resources.html')"
tal:define="resources resources|python:list(item.resources())"
tal:condition="resources">
<h2 i18n:translate="">Resources</h2>
<form method="post"
tal:omit-tag="not:item/editable">
<table class="listing"
metal:define-macro="resources">
<tr tal:define="sortcol request/resources_sortcol|nothing;
sortdir request/resources_sortdir|string:ascending">
<th tal:condition="item/showCheckboxes|nothing">&nbsp;</th>
<th i18n:translate="">Title
<span tal:condition="python: sortcol == 'title'"
tal:attributes="class sortdir">&nbsp;&nbsp;
</span></th>
<th i18n:translate="">Type</th>
<th i18n:translate=""
tal:condition="view/useVersioning">V</th>
<th i18n:translate="">Size</th>
<th i18n:translate="">Modification Date</th>
<th i18n:translate="">Author(s)</th>
<th i18n:translate=""
tal:condition="view/showObjectActions">Info</th>
</tr>
<tbody withHandles="true" id="resources_list"
tal:attributes="dojoType python:
item.editable and 'dojo.dnd.Source' or ''">
<tal:items repeat="related resources">
<tal:item define="class python:
repeat['related'].odd() and 'even' or 'odd';">
<tr tal:attributes="class string:$class dojoDndItem dojoDndHandle;
id related/uniqueId">
<td tal:condition="item/showCheckboxes|nothing"
tal:define="uid related/uniqueId"
class="checkbox">
<input type="checkbox" name="selection:list" checked
tal:attributes="value uid;" /></td>
<td valign="top"
tal:define="icon related/icon">
<a dojoType="dojox.image.Lightbox" group="mediasset"
tal:condition="icon"
tal:attributes="href related/fullImage/src|nothing;
title related/fullImage/title|related/title">
<img tal:attributes="src icon/src" />
</a>
<a tal:attributes="href python: view.getUrlForTarget(related);
title related/relationInfo">
<div tal:content="related/title">Resource Title</div>
</a>
</td>
<td class="center">
<span tal:replace="related/longTypeTitle">Type</span></td>
<tal:version tal:condition="view/useVersioning">
<td class="center"
tal:define="versionId related/versionId">
<a tal:condition="not:related/versionable/notVersioned|nothing"
tal:content="versionId"
tal:omit-tag="python: versionId=='1.1'"
tal:define="url python: view.getUrlForTarget(related)"
tal:attributes="href string:${url}?loops.viewName=listversions">1.1</a>
</td>
</tal:version>
<td class="nowrap number">
<span tal:replace="related/context/sizeForDisplay">2 MB</span>
</td>
<td><span tal:replace="related/modified">2007-03-30</span></td>
<td tal:attributes="title related/creators">
<span tal:replace="related/lastCreator">Author</span></td>
<td class="nowrap center"
tal:define="target nocall:related;
style nothing"
tal:condition="view/showObjectActions">
<div metal:use-macro="views/node_macros/object_actions" />
<input type="hidden" name="resources_tokens:list"
tal:attributes="value related/uidToken" />
</td>
</tr>
</tal:item>
</tal:items>
</tbody>
</table>
<input type="hidden" name="loops.viewName" value="index.html" />
<tal:changeorder condition="item/editable">
<input type="submit" style="display: none"
name="resources_change_order" id="resources_change_order"
value="Save Changes"
i18n:attributes="value" />
<script language="javascript">
dojo.subscribe('/dnd/drop', function(data) {
if (data.node.id == 'resources_list') {
dojo.byId('resources_change_order').style.display = ''}});
</script>
</tal:changeorder>
</form>
</div>
</metal:resources>
<metal:listing define-macro="conceptlisting">
<div>
<metal:fields use-macro="item/template/macros/concepttitle" />
<metal:listing define-macro="conceptlisting2">
<metal:fields use-macro="item/template/macros/conceptparents" />
<metal:fields use-macro="item/template/macros/conceptchildren" />
<metal:fields use-macro="item/template/macros/conceptresources" />
</metal:listing>
</div>
</metal:listing>
<metal:listing define-macro="list_children">
<div tal:define="show_headline nothing">
<metal:fields use-macro="item/template/macros/concepttitle" /><br />
<metal:fields use-macro="item/template/macros/conceptchildren" />
</div>
</metal:listing>
<metal:listing define-macro="list_nested">
<div style="margin-left: 20px"
tal:define="item nocall:related;
level python:level + 1">
<tal:children condition="children">
<metal:list use-macro="item/template/macros/conceptchildren" />
</tal:children>
<tal:resources condition="resources">
<metal:list use-macro="item/template/macros/conceptresources" />
</tal:resources>
</div>
</metal:listing>
<!-- portlets -->
<metal:actions define-macro="parents">
<div tal:repeat="concept
macro/info/view/parentsForPortlet|macro/info/parentsForPortlet">
<a tal:attributes="href python: view.getUrlForTarget(concept);
title concept/relationInfo">
<span i18n:translate=""
tal:content="concept/title">Concept</span>
(<i tal:content="concept/typeTitle"
i18n:translate="">Type</i>)
</a>
</div>
</metal:actions>
<metal:sortable define-macro="sortable_column_header"
tal:define="tableName tableName|nothing">
<a title="tooltip_sort_column"
tal:define="colName col/name"
tal:omit-tag="python:not item.isSortableColumn(tableName, colName)"
tal:attributes="href python:item.getSortUrl(tableName, colName)"
i18n:attributes="title">
<span tal:content="col/title"
tal:attributes="class col/cssClass|nothing"
i18n:translate="" />
<img tal:define="src python:item.getSortImage(tableName, colName)"
tal:condition="src"
tal:attributes="src src" />
</a>
</metal:sortable>
</html>