Moderation view tabbed
two tabs for comments to moderate and comments approved
This commit is contained in:
parent
840bc8daa6
commit
875409daff
@ -1,129 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
|
|
||||||
xmlns:tal="http://xml.zope.org/namespaces/tal"
|
|
||||||
xmlns:metal="http://xml.zope.org/namespaces/metal"
|
|
||||||
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
||||||
lang="en"
|
|
||||||
metal:use-macro="context/main_template/macros/master"
|
|
||||||
i18n:domain="plone">
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<metal:main fill-slot="main">
|
|
||||||
<tal:main-macro metal:define-macro="main"
|
|
||||||
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime;
|
|
||||||
items view/comments;
|
|
||||||
filter view/filter|nothing;
|
|
||||||
Batch python:modules['Products.CMFPlone'].Batch;
|
|
||||||
b_size python:30;
|
|
||||||
b_start python:0;
|
|
||||||
b_start request/b_start | b_start;
|
|
||||||
moderation_enabled view/moderation_enabled;">
|
|
||||||
<script type="text/javascript"
|
|
||||||
tal:attributes="src string:${context/portal_url}/++plone++plone.app.discussion.javascripts/moderation.js">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h1 class="documentFirstHeading" i18n:translate="heading_comments_approved">
|
|
||||||
Comments approved
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div class="portalMessage warning"
|
|
||||||
tal:condition="not: view/moderation_enabled">
|
|
||||||
<strong i18n:translate="">Warning</strong>
|
|
||||||
<span tal:omit-tag="" i18n:translate="message_moderation_disabled">
|
|
||||||
Moderation workflow is disabled. You have to
|
|
||||||
<a i18n:name="enable_comment_workflow"
|
|
||||||
i18n:translate="message_enable_comment_workflow" href=""
|
|
||||||
tal:attributes="href string:${context/portal_url}/@@content-controlpanel?type_id=Discussion Item">
|
|
||||||
enable the 'Comment Review Workflow' for the Comment content
|
|
||||||
type</a> before you can moderate comments here.
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form tal:condition="not:items">
|
|
||||||
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
|
||||||
<p id="no-comments-message" i18n:translate="message_no_comments_approved">
|
|
||||||
No comments approved
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form method="post"
|
|
||||||
action="#"
|
|
||||||
tal:condition="items"
|
|
||||||
tal:define="batch python:Batch(items, b_size, int(b_start), orphan=1);">
|
|
||||||
|
|
||||||
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
|
||||||
|
|
||||||
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
|
||||||
|
|
||||||
<table id="review-comments" class="listing">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="nosort" i18n:translate="heading_commenter">Commenter</th>
|
|
||||||
<th class="nosort" i18n:translate="heading_date">Date</th>
|
|
||||||
<th class="nosort" i18n:translate="heading_in_reponse_to">In Response To</th>
|
|
||||||
<th class="nosort" i18n:translate="heading_comment">Comment</th>
|
|
||||||
<th class="nosort" i18n:translate="heading_approvedby">Approved by</th>
|
|
||||||
<th class="nosort" i18n:translate="heading_action">Action</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tal:block repeat="item batch">
|
|
||||||
<tr class="commentrow"
|
|
||||||
tal:define="even repeat/item/even;
|
|
||||||
email python:getattr(item.getObject(), 'author_email');
|
|
||||||
item_url item/getURL;"
|
|
||||||
tal:attributes="class python: even and 'odd' or 'even'">
|
|
||||||
<td>
|
|
||||||
<span tal:content="python:item.author_name or item.Creator">Name</span>
|
|
||||||
<tal:email tal:condition="email">
|
|
||||||
<br/>
|
|
||||||
<a tal:attributes="href string:mailto:$email;"
|
|
||||||
tal:content="email">Email
|
|
||||||
</a>
|
|
||||||
</tal:email>
|
|
||||||
</td>
|
|
||||||
<td tal:content="python:toLocalizedTime(item.created, long_format=1)"/>
|
|
||||||
<td>
|
|
||||||
<a tal:attributes="href item_url"
|
|
||||||
tal:content="item/in_response_to" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span tal:replace="item/Description" />
|
|
||||||
<a href=""
|
|
||||||
tal:attributes="href string:$item_url/getText"
|
|
||||||
tal:condition="python:item.Description.endswith('[...]')"
|
|
||||||
i18n:translate="label_show_full_comment_text"
|
|
||||||
class="show-full-comment-text">show full comment text</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="last-history-entry"
|
|
||||||
tal:attributes="data-href string:$item_url/@@historyview">
|
|
||||||
last history entry
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td class="actions">
|
|
||||||
<input type="hidden" name="selected_obj_paths:list" value="#"
|
|
||||||
tal:attributes="value item/getURL" />
|
|
||||||
<input id=""
|
|
||||||
class="destructive comment-delete-button"
|
|
||||||
type="submit"
|
|
||||||
value="Delete"
|
|
||||||
name="form.button.Delete"
|
|
||||||
i18n:attributes="value label_delete;"
|
|
||||||
tal:attributes="id item/id"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tal:block>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</tal:main-macro>
|
|
||||||
</metal:main>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -29,23 +29,6 @@
|
|||||||
permission="plone.app.discussion.ReviewComments"
|
permission="plone.app.discussion.ReviewComments"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Approved comments view -->
|
|
||||||
<browser:page
|
|
||||||
for="Products.CMFCore.interfaces.ISiteRoot"
|
|
||||||
name="comments-approved"
|
|
||||||
layer="..interfaces.IDiscussionLayer"
|
|
||||||
class=".moderation.ApprovedView"
|
|
||||||
permission="plone.app.discussion.ReviewComments"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<browser:page
|
|
||||||
for="plone.app.layout.navigation.interfaces.INavigationRoot"
|
|
||||||
name="comments-approved"
|
|
||||||
layer="..interfaces.IDiscussionLayer"
|
|
||||||
class=".moderation.ApprovedView"
|
|
||||||
permission="plone.app.discussion.ReviewComments"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- Moderation bulk actions view -->
|
<!-- Moderation bulk actions view -->
|
||||||
<browser:page
|
<browser:page
|
||||||
for="Products.CMFCore.interfaces.ISiteRoot"
|
for="Products.CMFCore.interfaces.ISiteRoot"
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<tal:main-macro metal:define-macro="main"
|
<tal:main-macro metal:define-macro="main"
|
||||||
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime;
|
tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime;
|
||||||
items view/comments;
|
items view/comments;
|
||||||
|
items_approved_or_rejected view/comments_approved;
|
||||||
filter view/filter|nothing;
|
filter view/filter|nothing;
|
||||||
Batch python:modules['Products.CMFPlone'].Batch;
|
Batch python:modules['Products.CMFPlone'].Batch;
|
||||||
b_size python:30;
|
b_size python:30;
|
||||||
@ -24,10 +25,6 @@
|
|||||||
<h1 class="documentFirstHeading" i18n:translate="heading_moderate_comments">
|
<h1 class="documentFirstHeading" i18n:translate="heading_moderate_comments">
|
||||||
Moderate comments
|
Moderate comments
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
|
||||||
<a tal:attributes="href string:${context/@@plone_portal_state/navigation_root_url}/comments-approved;">> <span
|
|
||||||
i18n:translate="heading_comments_approved">Comments approved</span></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="portalMessage warning"
|
<div class="portalMessage warning"
|
||||||
role="status"
|
role="status"
|
||||||
@ -43,120 +40,221 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form tal:condition="not:items">
|
<div class="pat-autotoc autotabs"
|
||||||
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
data-pat-autotoc="section:fieldset.tab;levels:legend;">
|
||||||
<p id="no-comments-message" i18n:translate="message_nothing_to_moderate">
|
<fieldset class="tab">
|
||||||
No comments to moderate.
|
<legend i18n:translate="heading_moderate_comments">
|
||||||
</p>
|
Moderate comments</legend>
|
||||||
|
<div>
|
||||||
|
<form tal:condition="not:items">
|
||||||
|
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
||||||
|
<p id="no-comments-message" i18n:translate="message_nothing_to_moderate">
|
||||||
|
No comments to moderate.
|
||||||
|
</p>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="post"
|
||||||
|
action="#"
|
||||||
|
tal:attributes="action string:${context/absolute_url}/@@bulk-actions"
|
||||||
|
tal:condition="items"
|
||||||
|
tal:define="batch python:Batch(items, b_size, int(b_start), orphan=1);">
|
||||||
|
|
||||||
|
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
||||||
|
|
||||||
|
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
||||||
|
|
||||||
|
<table id="review-comments" class="listing">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th id="bulkactions" class="nosort" colspan="7">
|
||||||
|
<select name="form.select.BulkAction">
|
||||||
|
<option selected="selected" value="-1" i18n:translate="title_bulkactions">Bulk Actions</option>
|
||||||
|
<option value="publish"
|
||||||
|
i18n:translate="bulkactions_publish"
|
||||||
|
tal:condition="python: filter != 'published' and moderation_enabled">Approve</option>
|
||||||
|
<option value="delete" i18n:translate="bulkactions_delete">Delete</option>
|
||||||
|
</select>
|
||||||
|
<input type="hidden" name="form.button.Filter" tal:attributes="value filter" value="" />
|
||||||
|
<input id="dobulkaction"
|
||||||
|
type="submit"
|
||||||
|
class="standalone allowMultiSubmit"
|
||||||
|
value="Apply"
|
||||||
|
name="form.button.BulkAction"
|
||||||
|
i18n:attributes="value label_apply;" />
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="nosort"><input name="check_all" type="checkbox" value="0" /></th>
|
||||||
|
<th class="nosort" i18n:translate="heading_commenter">Commenter</th>
|
||||||
|
<th class="nosort" i18n:translate="heading_date">Date</th>
|
||||||
|
<th class="nosort" i18n:translate="heading_in_reponse_to">In Response To</th>
|
||||||
|
<th class="nosort" i18n:translate="heading_comment">Comment</th>
|
||||||
|
<th class="nosort" i18n:translate="heading_action">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tal:block repeat="item batch">
|
||||||
|
<tr class="commentrow"
|
||||||
|
tal:define="even repeat/item/even;
|
||||||
|
email python:getattr(item.getObject(), 'author_email');"
|
||||||
|
tal:attributes="class python: even and 'odd' or 'even'">
|
||||||
|
<td class="notDraggable">
|
||||||
|
<input type="checkbox"
|
||||||
|
class="noborder"
|
||||||
|
name="paths:list" id="#"
|
||||||
|
value="#"
|
||||||
|
tal:attributes="value item/getPath;
|
||||||
|
id string:cb_${item/id};
|
||||||
|
checked item/checked|nothing;
|
||||||
|
alt string:Select ${item/Title};
|
||||||
|
title string:Select ${item/Title}" />
|
||||||
|
<input type="hidden" name="selected_obj_paths:list" value="#"
|
||||||
|
tal:attributes="value item/getURL" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span tal:content="python:item.author_name or item.Creator">Name</span>
|
||||||
|
<tal:email tal:condition="email">
|
||||||
|
<br/>
|
||||||
|
<a tal:attributes="href string:mailto:$email;"
|
||||||
|
tal:content="email">Email
|
||||||
|
</a>
|
||||||
|
</tal:email>
|
||||||
|
</td>
|
||||||
|
<td tal:content="python:toLocalizedTime(item.created, long_format=1)"/>
|
||||||
|
<td>
|
||||||
|
<a tal:attributes="href item/getURL"
|
||||||
|
tal:content="item/in_response_to" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span tal:replace="item/Description" />
|
||||||
|
<a href=""
|
||||||
|
tal:attributes="href string:${item/getURL}/getText"
|
||||||
|
tal:condition="python:item.Description.endswith('[...]')"
|
||||||
|
i18n:translate="label_show_full_comment_text"
|
||||||
|
class="show-full-comment-text">show full comment text</a>
|
||||||
|
</td>
|
||||||
|
<td class="actions">
|
||||||
|
<input id=""
|
||||||
|
class="context comment-publish-button"
|
||||||
|
type="submit"
|
||||||
|
value="Approve"
|
||||||
|
name="form.button.Publish"
|
||||||
|
i18n:attributes="value label_publish;"
|
||||||
|
tal:attributes="id item/id"
|
||||||
|
tal:condition="python:item.review_state == 'pending'"
|
||||||
|
/>
|
||||||
|
<input id=""
|
||||||
|
class="destructive comment-delete-button"
|
||||||
|
type="submit"
|
||||||
|
value="Delete"
|
||||||
|
name="form.button.Delete"
|
||||||
|
i18n:attributes="value label_delete;"
|
||||||
|
tal:attributes="id item/id"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tal:block>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
<fieldset class="tab">
|
||||||
|
<legend i18n:translate="heading_approved_and_rejected_comments">
|
||||||
|
Approved comments</legend>
|
||||||
|
<div>
|
||||||
|
<form tal:condition="not:items_approved_or_rejected">
|
||||||
|
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
||||||
|
<p id="no-comments-message" i18n:translate="message_no_comments_approved">
|
||||||
|
No comments approved
|
||||||
|
</p>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
<form method="post"
|
<form method="post"
|
||||||
action="#"
|
action="#"
|
||||||
tal:attributes="action string:${context/absolute_url}/@@bulk-actions"
|
tal:condition="items_approved_or_rejected"
|
||||||
tal:condition="items"
|
tal:define="batch python:Batch(items_approved_or_rejected, b_size, int(b_start), orphan=1);">
|
||||||
tal:define="batch python:Batch(items, b_size, int(b_start), orphan=1);">
|
|
||||||
|
|
||||||
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
<fieldset id="fieldset-moderate-comments" class="formPanel">
|
||||||
|
|
||||||
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
||||||
|
|
||||||
<table id="review-comments" class="listing">
|
<table id="review-comments" class="listing">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th id="bulkactions" class="nosort" colspan="7">
|
<th class="nosort" i18n:translate="heading_commenter">Commenter</th>
|
||||||
<select name="form.select.BulkAction">
|
<th class="nosort" i18n:translate="heading_date">Date</th>
|
||||||
<option selected="selected" value="-1" i18n:translate="title_bulkactions">Bulk Actions</option>
|
<th class="nosort" i18n:translate="heading_in_reponse_to">In Response To</th>
|
||||||
<option value="publish"
|
<th class="nosort" i18n:translate="heading_comment">Comment</th>
|
||||||
i18n:translate="bulkactions_publish"
|
<th class="nosort" i18n:translate="heading_approvedby">Approved by</th>
|
||||||
tal:condition="python: filter != 'published' and moderation_enabled">Approve</option>
|
<th class="nosort" i18n:translate="heading_action">Action</th>
|
||||||
<option value="delete" i18n:translate="bulkactions_delete">Delete</option>
|
</tr>
|
||||||
</select>
|
</thead>
|
||||||
<input type="hidden" name="form.button.Filter" tal:attributes="value filter" value="" />
|
<tbody>
|
||||||
<input id="dobulkaction"
|
<tal:block repeat="item batch">
|
||||||
type="submit"
|
<tr class="commentrow"
|
||||||
class="standalone allowMultiSubmit"
|
tal:define="even repeat/item/even;
|
||||||
value="Apply"
|
email python:getattr(item.getObject(), 'author_email');
|
||||||
name="form.button.BulkAction"
|
item_url item/getURL;"
|
||||||
i18n:attributes="value label_apply;" />
|
tal:attributes="class python: even and 'odd' or 'even'">
|
||||||
</th>
|
<td>
|
||||||
</tr>
|
<span tal:content="python:item.author_name or item.Creator">Name</span>
|
||||||
<tr>
|
<tal:email tal:condition="email">
|
||||||
<th class="nosort"><input name="check_all" type="checkbox" value="0" /></th>
|
<br/>
|
||||||
<th class="nosort" i18n:translate="heading_commenter">Commenter</th>
|
<a tal:attributes="href string:mailto:$email;"
|
||||||
<th class="nosort" i18n:translate="heading_date">Date</th>
|
tal:content="email">Email
|
||||||
<th class="nosort" i18n:translate="heading_in_reponse_to">In Response To</th>
|
</a>
|
||||||
<th class="nosort" i18n:translate="heading_comment">Comment</th>
|
</tal:email>
|
||||||
<th class="nosort" i18n:translate="heading_action">Action</th>
|
</td>
|
||||||
</tr>
|
<td tal:content="python:toLocalizedTime(item.created, long_format=1)"/>
|
||||||
</thead>
|
<td>
|
||||||
<tbody>
|
<a tal:attributes="href item_url"
|
||||||
<tal:block repeat="item batch">
|
tal:content="item/in_response_to" />
|
||||||
<tr class="commentrow"
|
</td>
|
||||||
tal:define="even repeat/item/even;
|
<td>
|
||||||
email python:getattr(item.getObject(), 'author_email');"
|
<span tal:replace="item/Description" />
|
||||||
tal:attributes="class python: even and 'odd' or 'even'">
|
<a href=""
|
||||||
<td class="notDraggable">
|
tal:attributes="href string:$item_url/getText"
|
||||||
<input type="checkbox"
|
tal:condition="python:item.Description.endswith('[...]')"
|
||||||
class="noborder"
|
i18n:translate="label_show_full_comment_text"
|
||||||
name="paths:list" id="#"
|
class="show-full-comment-text">show full comment text</a>
|
||||||
value="#"
|
</td>
|
||||||
tal:attributes="value item/getPath;
|
<td>
|
||||||
id string:cb_${item/id};
|
<span class="last-history-entry"
|
||||||
checked item/checked|nothing;
|
tal:attributes="data-href string:$item_url/@@historyview">
|
||||||
alt string:Select ${item/Title};
|
last history entry
|
||||||
title string:Select ${item/Title}" />
|
</span>
|
||||||
<input type="hidden" name="selected_obj_paths:list" value="#"
|
</td>
|
||||||
tal:attributes="value item/getURL" />
|
|
||||||
</td>
|
<td class="actions">
|
||||||
<td>
|
<input type="hidden" name="selected_obj_paths:list" value="#"
|
||||||
<span tal:content="python:item.author_name or item.Creator">Name</span>
|
tal:attributes="value item/getURL" />
|
||||||
<tal:email tal:condition="email">
|
<input id=""
|
||||||
<br/>
|
class="destructive comment-delete-button"
|
||||||
<a tal:attributes="href string:mailto:$email;"
|
type="submit"
|
||||||
tal:content="email">Email
|
value="Delete"
|
||||||
</a>
|
name="form.button.Delete"
|
||||||
</tal:email>
|
i18n:attributes="value label_delete;"
|
||||||
</td>
|
tal:attributes="id item/id"
|
||||||
<td tal:content="python:toLocalizedTime(item.created, long_format=1)"/>
|
/>
|
||||||
<td>
|
</td>
|
||||||
<a tal:attributes="href item/getURL"
|
</tr>
|
||||||
tal:content="item/in_response_to" />
|
</tal:block>
|
||||||
</td>
|
</tbody>
|
||||||
<td>
|
</table>
|
||||||
<span tal:replace="item/Description" />
|
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
||||||
<a href=""
|
</fieldset>
|
||||||
tal:attributes="href string:${item/getURL}/getText"
|
</form>
|
||||||
tal:condition="python:item.Description.endswith('[...]')"
|
|
||||||
i18n:translate="label_show_full_comment_text"
|
</div>
|
||||||
class="show-full-comment-text">show full comment text</a>
|
|
||||||
</td>
|
|
||||||
<td class="actions">
|
|
||||||
<input id=""
|
|
||||||
class="context comment-publish-button"
|
|
||||||
type="submit"
|
|
||||||
value="Approve"
|
|
||||||
name="form.button.Publish"
|
|
||||||
i18n:attributes="value label_publish;"
|
|
||||||
tal:attributes="id item/id"
|
|
||||||
tal:condition="python:item.review_state == 'pending'"
|
|
||||||
/>
|
|
||||||
<input id=""
|
|
||||||
class="destructive comment-delete-button"
|
|
||||||
type="submit"
|
|
||||||
value="Delete"
|
|
||||||
name="form.button.Delete"
|
|
||||||
i18n:attributes="value label_delete;"
|
|
||||||
tal:attributes="id item/id"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tal:block>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div metal:use-macro="here/batch_macros/macros/navigation" />
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</tal:main-macro>
|
</tal:main-macro>
|
||||||
</metal:main>
|
</metal:main>
|
||||||
|
|
||||||
|
@ -35,6 +35,10 @@ class View(BrowserView):
|
|||||||
review_state='pending',
|
review_state='pending',
|
||||||
sort_on='created',
|
sort_on='created',
|
||||||
sort_order='reverse')
|
sort_order='reverse')
|
||||||
|
self.comments_approved = catalog(object_provides=IComment.__identifier__,
|
||||||
|
review_state='published',
|
||||||
|
sort_on='created',
|
||||||
|
sort_order='reverse')
|
||||||
return self.template()
|
return self.template()
|
||||||
|
|
||||||
def moderation_enabled(self):
|
def moderation_enabled(self):
|
||||||
@ -54,31 +58,6 @@ class View(BrowserView):
|
|||||||
return False
|
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):
|
class ModerateCommentsEnabled(BrowserView):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user