Show info message after adding a comment when moderation is enabled.
svn path=/plone.app.discussion/trunk/; revision=30659
This commit is contained in:
		
							parent
							
								
									1ea36d7d82
								
							
						
					
					
						commit
						60b6196736
					
				@ -122,6 +122,11 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @button.buttonAndHandler(_(u"Comment"))
 | 
					    @button.buttonAndHandler(_(u"Comment"))
 | 
				
			||||||
    def handleComment(self, action):
 | 
					    def handleComment(self, action):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        context = aq_inner(self.context)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        wf = getToolByName(context, 'portal_workflow')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        data, errors = self.extractData()
 | 
					        data, errors = self.extractData()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        title = u""
 | 
					        title = u""
 | 
				
			||||||
@ -195,10 +200,20 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
 | 
				
			|||||||
                # Add comment to the conversation
 | 
					                # Add comment to the conversation
 | 
				
			||||||
                comment_id = conversation.addComment(comment)
 | 
					                comment_id = conversation.addComment(comment)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Redirect to comment (inside a content object page)
 | 
					            # Show info message when comment moderation is enabled
 | 
				
			||||||
            self.request.response.redirect(
 | 
					            if wf.getChainForPortalType('Discussion Item') == \
 | 
				
			||||||
                aq_parent(aq_inner(self.context)).absolute_url() +
 | 
					                ('comment_review_workflow',):
 | 
				
			||||||
                '#' + str(comment_id))
 | 
					
 | 
				
			||||||
 | 
					                IStatusMessage(self.context.REQUEST).addStatusMessage(
 | 
				
			||||||
 | 
					                    _("Your comment awaits moderator approval."),
 | 
				
			||||||
 | 
					                    type="info")
 | 
				
			||||||
 | 
					                self.request.response.redirect(
 | 
				
			||||||
 | 
					                    aq_parent(aq_inner(self.context)).absolute_url())
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                # Redirect to comment (inside a content object page)
 | 
				
			||||||
 | 
					                self.request.response.redirect(
 | 
				
			||||||
 | 
					                    aq_parent(aq_inner(self.context)).absolute_url() +
 | 
				
			||||||
 | 
					                    '#' + str(comment_id))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @button.buttonAndHandler(_(u"Cancel"))
 | 
					    @button.buttonAndHandler(_(u"Cancel"))
 | 
				
			||||||
    def handleCancel(self, action):
 | 
					    def handleCancel(self, action):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user