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;
 | 
					                   isAnonymousDiscussionAllowed view/anonymous_discussion_allowed;
 | 
				
			||||||
                   replies view/get_replies;
 | 
					                   replies view/get_replies;
 | 
				
			||||||
                   isAnon view/is_anonymous;
 | 
					                   isAnon view/is_anonymous;
 | 
				
			||||||
 | 
					                   showCommenterImage view/show_commenter_image;
 | 
				
			||||||
                   errors options/state/getErrors|nothing;"
 | 
					                   errors options/state/getErrors|nothing;"
 | 
				
			||||||
           tal:condition="isDiscussionAllowed"
 | 
					           tal:condition="isDiscussionAllowed"
 | 
				
			||||||
           i18n:domain="plone">
 | 
					           i18n:domain="plone">
 | 
				
			||||||
 | 
					    <h1 tal:content="showCommenterImage" />
 | 
				
			||||||
    <div class="reply"
 | 
					    <div class="reply"
 | 
				
			||||||
         tal:condition="python:isAnon and not isAnonymousDiscussionAllowed">
 | 
					         tal:condition="python:isAnon and not isAnonymousDiscussionAllowed">
 | 
				
			||||||
        <form tal:attributes="action view/login_action">
 | 
					        <form tal:attributes="action view/login_action">
 | 
				
			||||||
@ -34,7 +35,7 @@
 | 
				
			|||||||
                                 style string:margin-left: ${depth}em;
 | 
					                                 style string:margin-left: ${depth}em;
 | 
				
			||||||
                                 id string:comment-${reply/id}">
 | 
					                                 id string:comment-${reply/id}">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <div class="commentImage">
 | 
					                <div class="commentImage" tal:condition="showCommenterImage">
 | 
				
			||||||
                    <a href="" tal:condition="not:isAnon"
 | 
					                    <a href="" tal:condition="not:isAnon"
 | 
				
			||||||
                               tal:attributes="href author_home_url">
 | 
					                               tal:attributes="href author_home_url">
 | 
				
			||||||
                         <img src="defaultUser.gif"
 | 
					                         <img src="defaultUser.gif"
 | 
				
			||||||
 | 
				
			|||||||
@ -87,6 +87,12 @@ class CommentsViewlet(ViewletBase):
 | 
				
			|||||||
        settings = registry.for_interface(IDiscussionSettings)
 | 
					        settings = registry.for_interface(IDiscussionSettings)
 | 
				
			||||||
        return settings.anonymous_comments
 | 
					        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):
 | 
					    def is_anonymous(self):
 | 
				
			||||||
        return self.portal_state.anonymous()
 | 
					        return self.portal_state.anonymous()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -12,15 +12,18 @@
 | 
				
			|||||||
.commentImage {
 | 
					.commentImage {
 | 
				
			||||||
	width: 90px;
 | 
						width: 90px;
 | 
				
			||||||
	float: left;
 | 
						float: left;
 | 
				
			||||||
 | 
						/* Todo: This is only a temporary solution !!! */
 | 
				
			||||||
 | 
						background: #EEF3F5;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.commentImage img {
 | 
					.commentImage img {
 | 
				
			||||||
 | 
						   margin-right: 1em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.comment h3,
 | 
					.comment h3,
 | 
				
			||||||
.comment .documentByLine,
 | 
					.comment .documentByLine,
 | 
				
			||||||
.comment .commentBody {
 | 
					.comment .commentBody {
 | 
				
			||||||
	margin-left: 90px;
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Reply Form
 | 
					/* Reply Form
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user