From 05f46268f42cb8f23e9d6b7fe4be73af66344a7c Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 27 May 2009 13:23:25 +0000 Subject: [PATCH] comment view that redirects to the comment added. no unit test so far! svn path=/plone.app.discussion/trunk/; revision=27144 --- plone/app/discussion/browser/comments.py | 10 ++++++++++ plone/app/discussion/browser/configure.zcml | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 51b021e..5ee5444 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -15,6 +15,16 @@ from plone.app.discussion.comment import CommentFactory 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): """Discussion Viewlet """ diff --git a/plone/app/discussion/browser/configure.zcml b/plone/app/discussion/browser/configure.zcml index 561dda7..8cd8647 100644 --- a/plone/app/discussion/browser/configure.zcml +++ b/plone/app/discussion/browser/configure.zcml @@ -18,7 +18,16 @@ permission="zope2.View" /> - + + + + - +