move comment view from browser/comments.py to browser/comment.py.

svn path=/plone.app.discussion/trunk/; revision=33214
This commit is contained in:
Timo Stollenwerk 2010-01-18 09:54:27 +00:00
parent dc2e5232f7
commit d1bd1469c8
3 changed files with 18 additions and 15 deletions

View File

@ -0,0 +1,16 @@
from Acquisition import aq_parent
from Products.Five.browser import BrowserView
class View(BrowserView):
"""Comment View.
Redirect from /path/to/object/++conversation++default/123456789
to /path/to/object#comment-123456789.
"""
def __call__(self):
comment_id = aq_parent(self).id
self.request.response.redirect(
aq_parent(aq_parent(aq_parent(self))).absolute_url() +
'#' + str(comment_id))

View File

@ -41,20 +41,6 @@ from plone.z3cform import layout, z2
from plone.z3cform.fieldsets import extensible
class View(BrowserView):
"""Comment View.
Redirect from /path/to/object/++conversation++default/123456789
to /path/to/object#comment-123456789.
"""
def __call__(self):
comment_id = aq_parent(self).id
self.request.response.redirect(
aq_parent(aq_parent(aq_parent(self))).absolute_url() +
'#' + str(comment_id))
class AutoResizeTextArea(TextAreaWidget):
"""Textarea with autoresize CSS class.
"""
@ -218,6 +204,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
# a cancel button that is handled by a jQuery method.
pass
class CommentsViewlet(ViewletBase, layout.FormWrapper):
form = CommentForm

View File

@ -83,7 +83,7 @@
name="view"
for="plone.app.discussion.interfaces.IComment"
layer="..interfaces.IDiscussionLayer"
class=".comments.View"
class=".comment.View"
permission="zope2.View"
/>