Skip to content

Commit

Permalink
add parent node and view it. looks the same as subsequent note. bette…
Browse files Browse the repository at this point in the history
…r visual seperation necessary.
  • Loading branch information
thet committed Jun 2, 2012
1 parent 10b277e commit b8fc5b9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/g24/elements/browser/threadview.pt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,26 @@
<body>

<metal:content-core fill-slot="content-core"><metal:block define-macro="content-core">
<ul class="threadview">
<li class="threadview-level-0">
<tal:article replace="structure python:view.element_provider(context)"/>
<tal:threadrunner replace="structure view/start_recurse"/>
<ul class="threadview parent" tal:define="parent nocall:view/parent" tal:omit-tag="not:parent">
<li class="threadview-level--1 parent" tal:omit-tag="not:parent">

<tal:article
replace="structure python:view.element_provider(parent)"
condition="parent" />

<ul class="threadview">
<li class="threadview-level-0">

<tal:article replace="structure python:view.element_provider(context)" />

<tal:threadrunner replace="structure view/start_recurse" />

</li>
</ul>

</li>
</ul>

</metal:block></metal:content-core>
</body>
</html>
11 changes: 11 additions & 0 deletions src/g24/elements/browser/threadview.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from Acquisition import aq_base, aq_inner, aq_parent
from Products.Five.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.navigation.navtree import buildFolderTree
Expand All @@ -9,6 +10,16 @@

class ThreadView(BrowserView):

def __init__(self, context, request):
self.context = context
self.request = request

#parent = getattr(context, '__parent__', None)
#parent = self.context.getParentNode()
parent = aq_parent(self.context)
if parent and not IBasetype.providedBy(parent): parent = None
self.parent = aq_inner(parent)

def itemtree(self):
context = self.context
query = {}
Expand Down

0 comments on commit b8fc5b9

Please sign in to comment.