Skip to content

Commit 99f864b

Browse files
author
Richard Jones
committed
added new example
1 parent 3243062 commit 99f864b

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

doc/customizing.txt

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.112 $
5+
:Version: $Revision: 1.113 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -3681,6 +3681,53 @@ different priorities, like::
36813681

36823682
and so on, with far less offensive colours :)
36833683

3684+
Editing multiple items in an index view
3685+
---------------------------------------
3686+
3687+
To edit the status of all items in the item index view, edit the
3688+
``issue.item.html``:
3689+
3690+
1. add a form around the listing table, so at the top it reads::
3691+
3692+
<form method="POST" tal:attributes="action request/classname">
3693+
<table class="list">
3694+
3695+
and at the bottom of that table::
3696+
3697+
</table>
3698+
</form
3699+
3700+
making sure you match the ``</table>`` from the list table, not the
3701+
navigation table or the subsequent form table.
3702+
3703+
2. in the display for the issue property, change::
3704+
3705+
<td tal:condition="request/show/status"
3706+
tal:content="python:i.status.plain() or default">&nbsp;</td>
3707+
3708+
to::
3709+
3710+
<td tal:condition="request/show/status"
3711+
tal:content="structure i/status/field">&nbsp;</td>
3712+
3713+
this will result in an edit field for the status property.
3714+
3715+
3. after the ``tal:block`` which lists the actual index items (marked by
3716+
``tal:repeat="i batch"``) add a new table row::
3717+
3718+
<tr>
3719+
<td tal:attributes="colspan python:len(request.columns)">
3720+
<input type="submit" value=" Save Changes ">
3721+
<input type="hidden" name="@action" value="edit">
3722+
<tal:block replace="structure request/indexargs_form" />
3723+
</td>
3724+
</tr>
3725+
3726+
which gives us a submit button, indicates that we are performing an edit
3727+
on any changed statuses and the final block will make sure that the
3728+
current index view parameters (filtering, columns, etc) will be used in
3729+
rendering the next page (the results of the editing).
3730+
36843731
-------------------
36853732

36863733
Back to `Table of Contents`_

0 commit comments

Comments
 (0)