Obey the 80 chars limit in the comments view.

svn path=/plone.app.discussion/trunk/; revision=39332
This commit is contained in:
Timo Stollenwerk 2010-08-28 20:19:58 +00:00
parent 785b006394
commit dc160f9d5e

View File

@ -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,
@ -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
@ -327,7 +329,8 @@ class CommentsViewlet(ViewletBase):
return portal_membership.isAnonymousUser()
def login_action(self):
return '%s/login_form?came_from=%s' % (self.navigation_root_url,
return '%s/login_form?came_from=%s' % \
(self.navigation_root_url,
url_quote(self.request.get('URL', '')),)
def format_time(self, time):