option to show commenter image added.
svn path=/plone.app.discussion/trunk/; revision=27353
This commit is contained in:
		
							parent
							
								
									353c6acfd0
								
							
						
					
					
						commit
						e98a39907a
					
				@ -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"
 | 
			
		||||
 | 
			
		||||
@ -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()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user