provide a collection of sub-parts of a page that may be placed separately on the page
This commit is contained in:
parent
cd65a3f7b5
commit
396d4727dc
2 changed files with 13 additions and 0 deletions
|
@ -192,6 +192,7 @@ class BaseView(GenericView, I18NView, SortableMixin):
|
|||
actions = {}
|
||||
portlet_actions = []
|
||||
parts = ()
|
||||
subparts = ()
|
||||
icon = None
|
||||
modeName = 'view'
|
||||
isToplevel = False
|
||||
|
|
|
@ -98,6 +98,18 @@ class NodeView(BaseView):
|
|||
def macro(self):
|
||||
return self.template.macros['content']
|
||||
|
||||
@Lazy
|
||||
def subparts(self):
|
||||
def getParts(n):
|
||||
t = n.targetObjectView
|
||||
if t is None:
|
||||
return []
|
||||
return t.subparts
|
||||
parts = getParts(self)
|
||||
for n in self.textItems:
|
||||
parts.extend(getParts(n))
|
||||
return parts
|
||||
|
||||
def update(self):
|
||||
result = super(NodeView, self).update()
|
||||
self.recordAccess()
|
||||
|
|
Loading…
Add table
Reference in a new issue