loops/compound/book/view_macros.pt

170 lines
6.9 KiB
XML

<html i18n:domain="loops">
<metal:children define-macro="children"
tal:define="children children|python:list(item.children())">
<tal:child repeat="related children">
<div tal:define="children python:list(related.children());
resources python:list(related.resources());
hideEmpty python:item.getOptions('hide_empty_children');
level python:level + 1"
tal:condition="python:not hideEmpty or children or resources"
tal:attributes="class string:content-$level">
<h3><a tal:attributes="href python:view.getUrlForTarget(related)"
tal:content="related/title" />
</h3>
<div class="description"
tal:content="structure related/renderedDescription" />
<tal:nested condition="python:related.getOptions('show_nested_children')">
<metal:children use-macro="item/book_macros/nested_children" />
</tal:nested>
</div>
</tal:child>
</metal:children>
<metal:nested define-macro="nested_children"
tal:define="children children|python:list(item.children())">
<tal:child repeat="related children">
<div tal:define="level python:level + 1"
tal:attributes="class string:nested content-$level">
<h3>
<a tal:attributes="href python:view.getUrlForTarget(related)"
tal:content="related/title" />
</h3>
<div tal:content="structure related/renderedDescription" />
</div>
</tal:child>
</metal:nested>
<metal:book define-macro="book">
<metal:info use-macro="view/concept_macros/concepttitle" />
<metal:info use-macro="item/book_macros/children" />
</metal:book>
<metal:section define-macro="section">
<metal:navigation define-macro="navigation"
tal:condition="item/showNavigation">
<div tal:define="parent nocall:item/breadcrumbsParent;
pred nocall:item/predecessor;
succ nocall:item/successor">
<a tal:condition="nocall:pred"
tal:attributes="href pred/targetUrl;
title pred/title">
<img src="/@@/cybertools.icons/arrow_left.png" /></a>
<a tal:condition="nocall:parent"
tal:attributes="href parent/targetUrl;
title parent/title">
<img src="/@@/cybertools.icons/arrow_up.png" /></a>
<a tal:condition="nocall:succ"
tal:attributes="href succ/targetUrl;
title succ/title">
<img src="/@@/cybertools.icons/arrow_right.png" /></a>
</div>
</metal:navigation>
<metal:info use-macro="view/concept_macros/concepttitle" />
<metal:info use-macro="item/book_macros/children" />
<metal:text define-macro="textresources">
<div style="clear: both"
tal:repeat="related item/textResources">
<div class="span-4">
<div metal:define-macro="default_text"
tal:attributes="class python:
item.getCssClassForResource(related)">
<h3 tal:define="ttitle python:item.getTitleForResource(related)"
tal:condition="ttitle"
tal:content="ttitle" />
<img class="flow-left" style="padding-top: 5px"
tal:define="icon python:item.getIconForResource(related)"
tal:condition="icon"
tal:attributes="src icon" />
<span tal:content="structure related/render" />
</div>
</div>
<div class="span-2 last" style="padding-top: 0.4em">
<div class="object-actions" style="padding-top: 0"
tal:define="url python:view.getUrlForTarget(related.context)"
tal:condition="related/editable">
<a i18n:translate="" i18n:attributes="title"
title="Edit"
tal:define="targetUid python:view.getUidForObject(related.context);
url
string:$url/edit_object.html?version=this&targetUid=$targetUid"
tal:attributes="href url;
onclick string:objectDialog('edit', '$url');;
return false">
<img tal:attributes="src
string:$resourceBase/cybertools.icons/vcard_edit.png" /></a>
<a i18n:translate="" i18n:attributes="title"
title="Edit with external editor."
xxtal:condition="related/xeditable"
tal:condition="nothing"
tal:attributes="href string:$url/external_edit?version=this">
<img tal:attributes="src
string:$resourceBase/cybertools.icons/application_edit.png" /></a>
</div>
<div tal:repeat="parent python:item.getParentsForResource(related)">
<a tal:content="parent/title"
tal:attributes="href python:view.getUrlForTarget(parent)" />
</div>
<div tal:repeat="image python:
item.images[repeat['related'].index() + 1]">
<a dojoType="dojox.image.Lightbox" group="mediasset"
i18n:attributes="title"
tal:attributes="href image/fullImageUrl;
title image/title">
<img tal:attributes="src image/src;
alt image/title" /></a>
</div>
<!-- TODO: links to files -->
</div>
</div>
</metal:text>
<br style="clear: both" />
<metal:navigation use-macro="item/book_macros/navigation" />
<br />
</metal:section>
<metal:topic define-macro="topic"
tal:define="children children|python:list(item.children());
textResources textResources|item/textResources;
resources item/otherResources">
<metal:info use-macro="view/concept_macros/concepttitle" />
<h2 i18n:translate=""
tal:condition="children">Children</h2>
<metal:children use-macro="item/book_macros/children" />
<h2 i18n:translate=""
tal:condition="textResources">Text Elements</h2>
<div>
<div tal:repeat="related textResources"
tal:define="level python:level + 1"
tal:attributes="class string:content-$level">
<h3>
<a tal:attributes="href python:view.getUrlForTarget(related.context)"
tal:content="related/title" />
</h3>
<div>
<div tal:replace="structure related/renderShortText" />
<p>
<a i18n:translate=""
tal:attributes="href python:view.getUrlForTarget(related.context)">
more...</a></p>
<div tal:repeat="image python:
item.images[repeat['related'].index() + 1]">
<a dojoType="dojox.image.Lightbox" group="mediasset"
i18n:attributes="title"
tal:attributes="href image/fullImageUrl;
title image/title">
<img tal:attributes="src image/src;
alt image/title" /></a>
</div>
</div>
</div>
<metal:info use-macro="view/concept_macros/conceptresources" />
</metal:topic>
</html>