From dc160f9d5e6193d36fa58b3e4402028faf786f8f Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 28 Aug 2010 20:19:58 +0000 Subject: [PATCH] Obey the 80 chars limit in the comments view. svn path=/plone.app.discussion/trunk/; revision=39332 --- plone/app/discussion/browser/comments.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index ff74ee1..4a68ea3 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -92,7 +92,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form): self.actions['cancel'].addClass("hide") self.actions['comment'].addClass("context") - @button.buttonAndHandler(_(u"add_comment_button",default=u"Comment"), + @button.buttonAndHandler(_(u"add_comment_button", default=u"Comment"), name='comment') def handleComment(self, action): context = aq_inner(self.context) @@ -112,7 +112,8 @@ class CommentForm(extensible.ExtensibleForm, form.Form): registry = queryUtility(IRegistry) settings = registry.forInterface(IDiscussionSettings) portal_membership = getToolByName(self.context, 'portal_membership') - if settings.captcha != 'disabled' and portal_membership.isAnonymousUser(): + if settings.captcha != 'disabled' and \ + portal_membership.isAnonymousUser(): if not 'captcha' in data: data['captcha'] = u"" captcha = CaptchaValidator(self.context, @@ -132,7 +133,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form): if 'author_email' in data: author_email = data['author_email'] #if 'author_notification' in data: - # author_notification = data['author_notification'] + # author_notification = data['author_notification'] # The add-comment view is called on the conversation object conversation = IConversation(self.__parent__) @@ -306,7 +307,8 @@ class CommentsViewlet(ViewletBase): portal_membership = getToolByName(self.context, 'portal_membership', None) - return portal_membership.getPersonalPortrait(username).absolute_url(); + return portal_membership.getPersonalPortrait(username)\ + .absolute_url() def anonymous_discussion_allowed(self): # Check if anonymous comments are allowed in the registry @@ -325,10 +327,11 @@ class CommentsViewlet(ViewletBase): 'portal_membership', None) return portal_membership.isAnonymousUser() - + def login_action(self): - return '%s/login_form?came_from=%s' % (self.navigation_root_url, - url_quote(self.request.get('URL', '')),) + return '%s/login_form?came_from=%s' % \ + (self.navigation_root_url, + url_quote(self.request.get('URL', '')),) def format_time(self, time): # We have to transform Python datetime into Zope DateTime