-
|
+
|
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:
|