diff --git a/news/159.enhancement b/news/159.enhancement new file mode 100644 index 0000000..f690a5c --- /dev/null +++ b/news/159.enhancement @@ -0,0 +1,2 @@ +Additional view for approved comments +[ksuess] diff --git a/plone/app/discussion/browser/comments_approved.pt b/plone/app/discussion/browser/comments_approved.pt new file mode 100644 index 0000000..1149e97 --- /dev/null +++ b/plone/app/discussion/browser/comments_approved.pt @@ -0,0 +1,129 @@ + + + + + + + +

+ Comments approved +

+ +
+ Warning + + Moderation workflow is disabled. You have to + + enable the 'Comment Review Workflow' for the Comment content + type before you can moderate comments here. + +
+ +
+
+

+ No comments approved +

+
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
CommenterDateIn Response ToCommentApproved byAction
+ Name + +
+ Email + +
+
+ + + + + show full comment text + + + last history entry + + + + +
+
+
+
+ +
+
+ + + diff --git a/plone/app/discussion/browser/configure.zcml b/plone/app/discussion/browser/configure.zcml index 7bb5aac..6caff55 100644 --- a/plone/app/discussion/browser/configure.zcml +++ b/plone/app/discussion/browser/configure.zcml @@ -29,6 +29,23 @@ permission="plone.app.discussion.ReviewComments" /> + + + + + Moderate comments +

+ > Comments approved +

- + diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index c18be49..556b604 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -52,6 +52,31 @@ class View(BrowserView): return False +class ApprovedView(View): + """Overview comments already approved.""" + template = ViewPageTemplateFile('comments_approved.pt') + try: + template.id = '@@comments-approved' + except AttributeError: + # id is not writeable in Zope 2.12 + pass + + def __call__(self): + self.request.set('disable_border', True) + context = aq_inner(self.context) + catalog = getToolByName(context, 'portal_catalog') + self.comments = catalog(object_provides=IComment.__identifier__, + review_state='published', + sort_on='created', + sort_order='reverse') + + # print("*** approved comments") + # print(self.comments) + # for el in self.comments: + # print(el.id, el.review_state) + return self.template() + + class ModerateCommentsEnabled(BrowserView): def __call__(self): diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 788d54d..3baca53 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -134,7 +134,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable, return self.id def getText(self, targetMimetype=None): - # The body text of a comment. + """The body text of a comment.""" transforms = getToolByName(self, 'portal_transforms') if targetMimetype is None: