move comment view from browser/comments.py to browser/comment.py.
svn path=/plone.app.discussion/trunk/; revision=33214
This commit is contained in:
parent
dc2e5232f7
commit
d1bd1469c8
16
plone/app/discussion/browser/comment.py
Normal file
16
plone/app/discussion/browser/comment.py
Normal 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))
|
@ -41,20 +41,6 @@ from plone.z3cform import layout, z2
|
|||||||
from plone.z3cform.fieldsets import extensible
|
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):
|
class AutoResizeTextArea(TextAreaWidget):
|
||||||
"""Textarea with autoresize CSS class.
|
"""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.
|
# a cancel button that is handled by a jQuery method.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class CommentsViewlet(ViewletBase, layout.FormWrapper):
|
class CommentsViewlet(ViewletBase, layout.FormWrapper):
|
||||||
|
|
||||||
form = CommentForm
|
form = CommentForm
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
name="view"
|
name="view"
|
||||||
for="plone.app.discussion.interfaces.IComment"
|
for="plone.app.discussion.interfaces.IComment"
|
||||||
layer="..interfaces.IDiscussionLayer"
|
layer="..interfaces.IDiscussionLayer"
|
||||||
class=".comments.View"
|
class=".comment.View"
|
||||||
permission="zope2.View"
|
permission="zope2.View"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user