show the second "login to comment"-button (below the comments) only when there are replies.

svn path=/plone.app.discussion/trunk/; revision=27198
This commit is contained in:
Timo Stollenwerk 2009-05-28 15:08:36 +00:00
parent aa50c33d8d
commit 49aab7389b
2 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,7 @@
</div>
<div class="reply"
tal:condition="isAnon">
tal:condition="python: isAnon and replies">
<form tal:attributes="action view/login_action">
<input class="standalone"
style="margin-bottom: 1.25em;"

View File

@ -61,7 +61,11 @@ class CommentsViewlet(ViewletBase):
def get_replies(self):
# Return all direct replies
conversation = conversationAdapterFactory(self.context)
if conversation.total_comments > 0:
return conversation.getThreads()
else:
return False
def is_anonymous(self):
return self.portal_state.anonymous()