comment view that redirects to the comment added. no unit test so far!
svn path=/plone.app.discussion/trunk/; revision=27144
This commit is contained in:
parent
5f52a0d56b
commit
05f46268f4
@ -15,6 +15,16 @@ from plone.app.discussion.comment import CommentFactory
|
|||||||
|
|
||||||
from zope.component import createObject
|
from zope.component import createObject
|
||||||
|
|
||||||
|
class View(BrowserView):
|
||||||
|
"""Comment View
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
# Redirect from /path/to/object/++conversation++default/123456789
|
||||||
|
# to /path/to/object#comment-123456789
|
||||||
|
comment_id = aq_parent(self).id
|
||||||
|
self.request.response.redirect(aq_parent(aq_parent(aq_parent(self))).absolute_url() + '#comment-' + comment_id)
|
||||||
|
|
||||||
class CommentsViewlet(BrowserView):
|
class CommentsViewlet(BrowserView):
|
||||||
"""Discussion Viewlet
|
"""Discussion Viewlet
|
||||||
"""
|
"""
|
||||||
|
@ -18,7 +18,16 @@
|
|||||||
permission="zope2.View"
|
permission="zope2.View"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- add-comment view -->
|
<!-- Comment view -->
|
||||||
|
<browser:view
|
||||||
|
name="view"
|
||||||
|
for="plone.app.discussion.interfaces.IComment"
|
||||||
|
layer="..interfaces.IDiscussionLayer"
|
||||||
|
class=".comments.View"
|
||||||
|
permission="zope2.View"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Add comment view -->
|
||||||
<browser:view
|
<browser:view
|
||||||
name="add-comment"
|
name="add-comment"
|
||||||
for="plone.app.discussion.interfaces.IConversation"
|
for="plone.app.discussion.interfaces.IConversation"
|
||||||
@ -27,7 +36,7 @@
|
|||||||
permission="zope2.View"
|
permission="zope2.View"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- reply-to-comment view -->
|
<!-- Reply to comment view -->
|
||||||
<browser:view
|
<browser:view
|
||||||
name="reply-to-comment"
|
name="reply-to-comment"
|
||||||
for="plone.app.discussion.interfaces.IConversation"
|
for="plone.app.discussion.interfaces.IConversation"
|
||||||
|
Loading…
Reference in New Issue
Block a user