show object actions correctly on blogs and blog posts

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3172 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-01-22 18:38:59 +00:00
parent afa64c7028
commit 2a656daa02
2 changed files with 37 additions and 29 deletions

View file

@ -156,6 +156,9 @@ class BlogPostView(ConceptView):
page=page, target=target))
#self.registerDojoTextWidget()
self.registerDojoDateWidget()
else:
actions = super(BlogPostView, self).getActions(category,
page=page, target=target)
return actions
def render(self):

View file

@ -2,42 +2,47 @@
$Id$ -->
<metal:block define-macro="blog">
<metal:title use-macro="item/conceptMacros/concepttitle" />
<div tal:repeat="related item/blogPosts"
class="blog">
<tal:child define="data related/data">
<h1 class="headline">
<a href="#"
tal:content="related/title"
tal:attributes="href python: view.getUrlForTarget(related);">Post</a>
</h1>
<div class="info"
tal:define="url data/creatorUrl|nothing">
<span tal:content="data/date">2008-01-02</span> /
<a tal:omit-tag="not:url"
tal:content="data/creator"
tal:attributes="href url">Will Smith</a>
</div>
<div class="description"
tal:define="description data/description"
tal:condition="description">
<span tal:content="structure description">Description</span></div>
<div class="text"
tal:condition="nothing"
xtal:condition="python: repeat['related'].index() < 3">
<span tal:content="structure python:
item.renderText(data['text'], related.adapted.textContentType)"></span>
</div>
</tal:child>
<div>
<metal:title use-macro="item/conceptMacros/concepttitle" />
<div tal:repeat="related item/blogPosts"
class="blog">
<tal:child define="data related/data">
<h1 class="headline">
<a href="#"
tal:content="related/title"
tal:attributes="href python: view.getUrlForTarget(related);">Post</a>
</h1>
<div class="info"
tal:define="url data/creatorUrl|nothing">
<span tal:content="data/date">2008-01-02</span> /
<a tal:omit-tag="not:url"
tal:content="data/creator"
tal:attributes="href url">Will Smith</a>
</div>
<div class="description"
tal:define="description data/description"
tal:condition="description">
<span tal:content="structure description">Description</span></div>
<div class="text"
tal:condition="nothing"
xtal:condition="python: repeat['related'].index() < 3">
<span tal:content="structure python:
item.renderText(data['text'], related.adapted.textContentType)"></span>
</div>
</tal:child>
</div>
<metal:resources use-macro="item/conceptMacros/conceptchildren" />
<metal:resources use-macro="item/conceptMacros/conceptresources" />
</div>
<metal:resources use-macro="item/conceptMacros/conceptchildren" />
<metal:resources use-macro="item/conceptMacros/conceptresources" />
</metal:block>
<div metal:define-macro="blogpost"
tal:define="data item/data"
class="blogpost">
<tal:actions condition="view/showObjectActions">
<div metal:use-macro="views/node_macros/object_actions" />
</tal:actions>
<h1 tal:attributes="ondblclick item/openEditWindow">
<span tal:content="item/title">Title</span>
</h1>