|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.112 $ |
| 5 | +:Version: $Revision: 1.113 $ |
6 | 6 |
|
7 | 7 | .. This document borrows from the ZopeBook section on ZPT. The original is at: |
8 | 8 | http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
@@ -3681,6 +3681,53 @@ different priorities, like:: |
3681 | 3681 |
|
3682 | 3682 | and so on, with far less offensive colours :) |
3683 | 3683 |
|
| 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"> </td> |
| 3707 | + |
| 3708 | + to:: |
| 3709 | + |
| 3710 | + <td tal:condition="request/show/status" |
| 3711 | + tal:content="structure i/status/field"> </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 | + |
3684 | 3731 | ------------------- |
3685 | 3732 |
|
3686 | 3733 | Back to `Table of Contents`_ |
|
0 commit comments