new special view 'listsubobjects' for nodes

This commit is contained in:
Helmut Merz 2011-10-03 14:47:52 +02:00
parent 29ad535ce5
commit 4996a51bc6
4 changed files with 51 additions and 2 deletions

View file

@ -6,6 +6,7 @@ $Id$
1.1
---
- new special view 'listsubobjects' for nodes
- allow for adoption of relations to a predicate interface;
with example implementation for a 'has Role' predicate in loops.organize
- external collection: provide functionality for automatically populate

View file

@ -486,6 +486,14 @@
factory="loops.browser.node.ListResources"
permission="zope.View" />
<zope:adapter
name="listsubobjects"
for="loops.interfaces.INode
zope.publisher.interfaces.browser.IBrowserRequest"
provides="zope.interface.Interface"
factory="loops.browser.node.ListSubobjects"
permission="zope.View" />
<zope:adapter
name="listchildren"
for="loops.interfaces.INode

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -676,6 +676,11 @@ class ListChildren(SpecialNodeView):
macroName = 'listchildren'
class ListSubobjects(SpecialNodeView):
macroName = 'listsubobjects'
class ConfigureView(NodeView):
""" An editing view for configuring a node, optionally creating
a target object.

View file

@ -166,12 +166,47 @@
<a href="#"
tal:attributes="href string:${view/url}/.${related/uniqueId};
title related/description"
tal:content="related/title">Resource Title</a>
tal:content="related/title">Concept Title</a>
</div>
</div>
</metal:children>
<metal:subobjects define-macro="listsubobjects"
tal:define="target nocall:item/targetObjectView">
<div class="content-1"
tal:content="structure item/body"
tal:attributes="ondblclick python:
target and target.openEditWindow('configure.html')
or item.openEditWindow();
id string:${view/itemNum}.body;">
Listing
</div>
<div tal:condition="nocall:target">
<div tal:attributes="ondblclick python: target.openEditWindow('configure.html')"
tal:define="children python:list(target.children())"
tal:condition="children">
<h3 i18n:translate="">Children</h3>
<div tal:repeat="related children">
<a tal:attributes="href python:view.getUrlForTarget(related);
title related/description"
tal:content="related/title">Concept Title</a>
</div>
</div>
<div tal:attributes="ondblclick python: target.openEditWindow('resources.html')"
tal:define="resources python:list(target.resources())"
tal:condition="resources">
<h3 i18n:translate="">Resources</h3>
<div tal:repeat="related resources">
<a tal:attributes="href python:view.getUrlForTarget(related);
title related/description"
tal:content="related/title">Resource Title</a>
</div>
</div>
</div>
</metal:subobjects>
<!-- menu -->
<metal:menu define-macro="menu"