add pagination to moderate comment view.

svn path=/plone.app.discussion/trunk/; revision=27752
This commit is contained in:
Timo Stollenwerk 2009-06-30 23:17:40 +00:00
parent 8c217ae45a
commit cfd70d8cc8
3 changed files with 41 additions and 30 deletions

View File

@ -10,7 +10,11 @@
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main"
tal:define="items view/comments;
filter view/filter|nothing;">
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;">
<h1 class="documentFirstHeading" i18n:translate="title_review">
Moderate comments
@ -49,13 +53,11 @@
</ul>
<form method="post"
action="#"
class="bulkactions"
tal:attributes="action string:${context/absolute_url}/@@bulk-actions">
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);">
<table id="review-comments" class="listing" style="width: 100%" tal:condition="items">
<thead>
<tr>
<th class="nosort bulkactions" colspan="7">
<div id="bulkactions">
<select name="form.select.BulkAction">
<option selected="selected" value="-1" i18n:translate="title_bulkactions">Bulk Actions</option>
<!--<option value="retract" i18n:translate="bulkactions_retract">Retract</option>-->
@ -72,8 +74,12 @@
value="Apply"
name="form.button.BulkAction"
i18n:attributes="value label_apply;" />
</th>
</tr>
</div>
<div metal:use-macro="here/batch_macros/macros/navigation" />
<table id="review-comments" class="listing" style="width: 100%">
<thead>
<tr>
<th class="nosort"><input name="check_all" type="checkbox" value="0" /></th>
<th i18n:translate="heading_author">Commenter</th>
@ -85,7 +91,7 @@
</tr>
</thead>
<tbody>
<tal:block repeat="item items">
<tal:block repeat="item batch">
<tr style="vertical-align: top" class="commentrow"
tal:define="odd repeat/item/odd"
tal:attributes="class python: odd and 'odd' or 'even'">
@ -137,6 +143,7 @@
</tal:block>
</tbody>
</table>
<div metal:use-macro="here/batch_macros/macros/navigation" />
</form>
</tal:main-macro>
</metal:main>

View File

@ -10,6 +10,7 @@ class View(BrowserView):
"""
template = ViewPageTemplateFile('moderation.pt')
template.id = '@@moderate-comments'
def __call__(self):

View File

@ -71,8 +71,15 @@ ul.filter {
background-color: #DEE7EC;
border-bottom: 1px solid #DEE7EC;
}
.bulkactions {
#bulkactions {
text-align: left;
background: #DEE7EC;
border: 1px solid #8CACBB;
}
#bulkactions select {
margin: 0.1em 0;
}
#dobulkaction {
@ -90,7 +97,3 @@ ul.filter {
#review-comments {
margin: 0;
}
#review-comments select {
margin: 0.1em 0;
}