option to show commenter image added.

svn path=/plone.app.discussion/trunk/; revision=27353
This commit is contained in:
Timo Stollenwerk 2009-06-08 08:23:18 +00:00
parent 353c6acfd0
commit e98a39907a
3 changed files with 13 additions and 3 deletions

View File

@ -3,10 +3,11 @@
isAnonymousDiscussionAllowed view/anonymous_discussion_allowed;
replies view/get_replies;
isAnon view/is_anonymous;
showCommenterImage view/show_commenter_image;
errors options/state/getErrors|nothing;"
tal:condition="isDiscussionAllowed"
i18n:domain="plone">
<h1 tal:content="showCommenterImage" />
<div class="reply"
tal:condition="python:isAnon and not isAnonymousDiscussionAllowed">
<form tal:attributes="action view/login_action">
@ -34,7 +35,7 @@
style string:margin-left: ${depth}em;
id string:comment-${reply/id}">
<div class="commentImage">
<div class="commentImage" tal:condition="showCommenterImage">
<a href="" tal:condition="not:isAnon"
tal:attributes="href author_home_url">
<img src="defaultUser.gif"

View File

@ -87,6 +87,12 @@ class CommentsViewlet(ViewletBase):
settings = registry.for_interface(IDiscussionSettings)
return settings.anonymous_comments
def show_commenter_image(self):
# Check if showing commenter image is enabled in the registry
registry = queryUtility(IRegistry)
settings = registry.for_interface(IDiscussionSettings)
return settings.show_commenter_image
def is_anonymous(self):
return self.portal_state.anonymous()

View File

@ -12,15 +12,18 @@
.commentImage {
width: 90px;
float: left;
/* Todo: This is only a temporary solution !!! */
background: #EEF3F5;
}
.commentImage img {
margin-right: 1em;
}
.comment h3,
.comment .documentByLine,
.comment .commentBody {
margin-left: 90px;
}
/* Reply Form