make filters look like Plone formTabs.

svn path=/plone.app.discussion/trunk/; revision=27753
This commit is contained in:
Timo Stollenwerk 2009-06-30 23:49:32 +00:00
parent cfd70d8cc8
commit 33577fa13d
2 changed files with 143 additions and 107 deletions

View File

@ -20,27 +20,27 @@
Moderate comments Moderate comments
</h1> </h1>
<ul class="filter"> <ul class="filter formTabs">
<li class="all"> <li class="all formTab firstFormTab">
<form method="post" <form method="post"
action="#" action="#"
tal:attributes="action string:${context/absolute_url}/@@moderate-comments"> tal:attributes="action string:${context/absolute_url}/@@moderate-comments">
<input type="submit" value="All" class="context" <input type="submit" value="All" class=""
tal:attributes="class python: not filter and 'context selected' or 'context'" /> tal:attributes="class python: not filter and 'selected' or ''" />
</form> </form>
</li> </li>
<li class="pending"> <li class="pending formTab">
<form method="post" action="#" tal:attributes="action string:${context/absolute_url}/@@moderate-comments"> <form method="post" action="#" tal:attributes="action string:${context/absolute_url}/@@moderate-comments">
<input type="hidden" name="form.button.Filter" value="pending" /> <input type="hidden" name="form.button.Filter" value="pending" />
<input type="submit" value="Pending" class="context" <input type="submit" value="Pending" class=""
tal:attributes="class python:filter == 'pending' and 'context selected' or 'context'"/> tal:attributes="class python:filter == 'pending' and 'selected' or ''"/>
</form> </form>
</li> </li>
<li class="approved"> <li class="approved formTab lastFormTab">
<form method="post" action="#" tal:attributes="action string:${context/absolute_url}/@@moderate-comments"> <form method="post" action="#" tal:attributes="action string:${context/absolute_url}/@@moderate-comments">
<input type="hidden" name="form.button.Filter" value="published" /> <input type="hidden" name="form.button.Filter" value="published" />
<input type="submit" value="Published" class="context" <input type="submit" value="Published" class=""
tal:attributes="class python:filter == 'published' and 'context selected' or 'context'"/> tal:attributes="class python:filter == 'published' and 'selected' or ''"/>
</form> </form>
</li> </li>
<!-- <!--
@ -51,99 +51,123 @@
</li> </li>
--> -->
</ul> </ul>
<!--
<ul class="formTabs">
<li class="formTab firstFormTab">
<a id="" class="selected" href="#">
<span>All</span>
</a>
</li>
<li class="formTab">
<a id="filter-pending" class="" href="#filter-pending">
<span>Pending</span>
</a>
</li>
<li class="formTab lastFormTab">
<a id="filter-published" class="" href="#filter-published">
<span>Published</span>
</a>
</li>
</ul>
-->
<form method="post" <form method="post"
action="#" action="#"
tal:attributes="action string:${context/absolute_url}/@@bulk-actions" tal:attributes="action string:${context/absolute_url}/@@bulk-actions"
tal:condition="items" tal:condition="items"
tal:define="batch python:Batch(items, b_size, int(b_start), orphan=1);"> tal:define="batch python:Batch(items, b_size, int(b_start), orphan=1);">
<div id="bulkactions"> <fieldset id="fieldset-moderate-comments" class="formPanel">
<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>-->
<option value="publish"
i18n:translate="bulkactions_publish"
tal:condition="python: filter != 'published'">Publish</option>
<!--<option value="mark_as_spam" i18n:translate="bulkactions_markasspam">Mark as Spam</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;" />
</div>
<div metal:use-macro="here/batch_macros/macros/navigation" /> <div metal:use-macro="here/batch_macros/macros/navigation" />
<table id="review-comments" class="listing" style="width: 100%"> <table id="review-comments" class="listing" style="width: 100%">
<thead> <thead>
<tr> <tr>
<th class="nosort"><input name="check_all" type="checkbox" value="0" /></th> <th id="bulkactions" class="nosort" colspan="7">
<th i18n:translate="heading_author">Commenter</th> <select name="form.select.BulkAction">
<th i18n:translate="heading_date">Date</th> <option selected="selected" value="-1" i18n:translate="title_bulkactions">Bulk Actions</option>
<th i18n:translate="heading_context">In Response To</th> <!--<option value="retract" i18n:translate="bulkactions_retract">Retract</option>-->
<th i18n:translate="heading_subject">Subject</th> <option value="publish"
<th i18n:translate="heading_comment">Comment</th> i18n:translate="bulkactions_publish"
<th class="nosort" i18n:translate="heading_action">Action</th> tal:condition="python: filter != 'published'">Publish</option>
</tr> <!--<option value="mark_as_spam" i18n:translate="bulkactions_markasspam">Mark as Spam</option>-->
</thead> <option value="delete" i18n:translate="bulkactions_delete">Delete</option>
<tbody> </select>
<tal:block repeat="item batch"> <input type="hidden" name="form.button.Filter" tal:attributes="value filter" value="" />
<tr style="vertical-align: top" class="commentrow" <input id="dobulkaction"
tal:define="odd repeat/item/odd"
tal:attributes="class python: odd 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 tal:content="item/Creator" />
<td tal:content="python:toLocalizedTime(item.ModificationDate, long_format=1)" />
<td>
<a tal:attributes="href item/getURL"
tal:content="item/@@plone_context_state/parent|nothing" />
</td>
<td>
<a tal:attributes="href item/getURL"
tal:content="item/Title" />
</td>
<td tal:content="structure python:view.cook(item.Description)" />
<td style="width: 11em;">
<input id=""
class="context comment-publish-button"
type="submit" type="submit"
value="Publish" class="standalone allowMultiSubmit"
name="form.button.Publish" value="Apply"
i18n:attributes="value label_publish" name="form.button.BulkAction"
tal:attributes="id item/id" i18n:attributes="value label_apply;" />
tal:condition="python:item.review_state == 'pending'" </th>
/>
<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> </tr>
</tal:block> <tr>
</tbody> <th class="nosort"><input name="check_all" type="checkbox" value="0" /></th>
</table> <th i18n:translate="heading_author">Commenter</th>
<div metal:use-macro="here/batch_macros/macros/navigation" /> <th i18n:translate="heading_date">Date</th>
<th i18n:translate="heading_context">In Response To</th>
<th i18n:translate="heading_subject">Subject</th>
<th i18n:translate="heading_comment">Comment</th>
<th class="nosort" i18n:translate="heading_action">Action</th>
</tr>
</thead>
<tbody>
<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'">
<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 tal:content="item/Creator" />
<td tal:content="python:toLocalizedTime(item.ModificationDate, long_format=1)" />
<td>
<a tal:attributes="href item/getURL"
tal:content="item/@@plone_context_state/parent|nothing" />
</td>
<td>
<a tal:attributes="href item/getURL"
tal:content="item/Title" />
</td>
<td tal:content="structure python:view.cook(item.Description)" />
<td style="width: 11em;">
<input id=""
class="context comment-publish-button"
type="submit"
value="Publish"
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> </form>
</tal:main-macro> </tal:main-macro>
</metal:main> </metal:main>

View File

@ -51,39 +51,51 @@
---------------------------------------------------------------- */ ---------------------------------------------------------------- */
ul.filter { ul.filter {
margin: 1em 0 0 1em; margin-top: 2em;
}
fieldset {
padding: 2em 0;
} }
.filter li { .filter li {
display: inline;
margin: 0 0.2em;
} }
.filter li a:link { .filter li a:link {
border-bottom: 0px solid transparent;
} }
.filter form { .filter form {
display: inline; display: inline;
} }
.filter .selected { .filter input.selected {
background-color: #DEE7EC; background: #DEE7EC;
border-bottom: 1px solid #DEE7EC; }
.filter .firstFormTab input {
border-left: 1px solid #8CACBB;
}
.filter .lastFormTab {
border-right: 1px solid #8CACBB;
}
.filter input {
background: White;
border-bottom: 1px solid #8CACBB;
border-left: 1px dotted #8CACBB;
border-top: 1px solid #8CACBB;
margin: 0;
padding: 0.125em 0.75em;
text-decoration: none;
} }
#bulkactions { #bulkactions {
text-align: left; text-align: left;
background: #DEE7EC;
border: 1px solid #8CACBB;
}
#bulkactions select {
margin: 0.1em 0;
} }
#dobulkaction { #dobulkaction {
margin: 0.45em 0; margin: 0.3em 0;
} }
.comment-publish-button { .comment-publish-button {