Bug 32197: Add page-section to catalog's stock rotation page
authorOwen Leonard <oleonard@myacpl.org>
Mon, 14 Nov 2022 17:20:50 +0000 (17:20 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 16 Nov 2022 12:27:08 +0000 (09:27 -0300)
This page wraps the content of the stock rotation page in the catalog
with a "page-section" div.

Note: This patch includes indentation changes, so use diff accordingly.

To test you  must have the StockRotation system preference enabled.
Apply the patch and locate a bibliographic record in the catalog.

- Click the "Rota" link in the sidebar.
- Confirm that the table of items on this page is surrounded by a
  container with a white-background.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt

index 0716462..c66e7da 100644 (file)
     [% IF no_op_set %]
         <h1 class="title">Stock rotation details for [% INCLUDE 'biblio-title.inc' %]</h1>
         [% IF rotas.count > 0 && items.size > 0 %]
-
-            <table class="items_table dataTable no-footer" role="grid">
-                <thead>
-                    <tr>
-                        <th>Barcode</th>
-                        <th>Call number</th>
-                        <th>Rota</th>
-                        <th>Rota status</th>
-                        <th>In transit</th>
-                        <th>Stages &amp; duration in days<br>(current stage highlighted)</th>
-                        <th>&nbsp;</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    [% FOREACH item IN items %]
+            <div class="page-section">
+                <table class="items_table dataTable no-footer" role="grid">
+                    <thead>
                         <tr>
-                            <td>[% item.bib_item.barcode | html %]</td>
-                            <td>[% item.bib_item.itemcallnumber | html %]</td>
-                            <td>
-                                [% item.rota.title | html %]
-                            </td>
-                            <td>
-                                [% IF item.rota %]
-                                    [% IF !item.rota.active %]
-                                        <span class="highlighted-row">
+                            <th>Barcode</th>
+                            <th>Call number</th>
+                            <th>Rota</th>
+                            <th>Rota status</th>
+                            <th>In transit</th>
+                            <th>Stages &amp; duration in days<br>(current stage highlighted)</th>
+                            <th>&nbsp;</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        [% FOREACH item IN items %]
+                            <tr>
+                                <td>[% item.bib_item.barcode | html %]</td>
+                                <td>[% item.bib_item.itemcallnumber | html %]</td>
+                                <td>
+                                    [% item.rota.title | html %]
+                                </td>
+                                <td>
+                                    [% IF item.rota %]
+                                        [% IF !item.rota.active %]
+                                            <span class="highlighted-row">
+                                        [% END %]
+                                            [% IF item.rota.active %]
+                                                <span>Active</span>
+                                            [% ELSE %]
+                                                <span>Inactive</span>
+                                            [% END %]
+                                        [% IF !item.rota.active %]
+                                            </span>
+                                        [% END %]
                                     [% END %]
-                                        [% IF item.rota.active %]
-                                            <span>Active</span>
+                                </td>
+                                <td>
+                                    [% IF item.bib_item.get_transfer %]
+                                        <span>Yes</span>
+                                    [% ELSE %]
+                                        <span>No</span>
+                                    [% END %]
+                                </td>
+                                <td>
+                                    [% FOREACH this_stage IN item.stages %]
+                                        [% IF this_stage.stage_id == item.stockrotationitem.stage.stage_id %]
+                                            <span class="stage highlight_stage">
                                         [% ELSE %]
-                                            <span>Inactive</span>
+                                            <span class="stage">
                                         [% END %]
-                                    [% IF !item.rota.active %]
+                                        [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
                                         </span>
+                                        &raquo;
                                     [% END %]
-                                [% END %]
-                            </td>
-                            <td>
-                                [% IF item.bib_item.get_transfer %]
-                                    <span>Yes</span>
-                                [% ELSE %]
-                                    <span>No</span>
-                                [% END %]
-                            </td>
-                            <td>
-                                [% FOREACH this_stage IN item.stages %]
-                                    [% IF this_stage.stage_id == item.stockrotationitem.stage.stage_id %]
-                                        <span class="stage highlight_stage">
-                                    [% ELSE %]
+                                    [% IF item.stages.size > 0 %]
                                         <span class="stage">
+                                            [% IF item.rota.cyclical %]
+                                                START
+                                            [% ELSE %]
+                                                END
+                                            [% END %]
+                                        </span>
                                     [% END %]
-                                    [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
-                                    </span>
-                                    &raquo;
-                                [% END %]
-                                [% IF item.stages.size > 0 %]
-                                    <span class="stage">
-                                        [% IF item.rota.cyclical %]
-                                            START
+                                </td>
+                                <td class="actions">
+                                    [% IF item.stockrotationitem %]
+                                        [% in_transit = item.bib_item.get_transfer %]
+                                        [% IF !in_transit && item.stages.size > 1 %]
+                                            <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
                                         [% ELSE %]
-                                            END
+                                            <a class="btn btn-default btn-xs" disabled>
                                         [% END %]
-                                    </span>
-                                [% END %]
-                            </td>
-                            <td class="actions">
-                                [% IF item.stockrotationitem %]
-                                    [% in_transit = item.bib_item.get_transfer %]
-                                    [% IF !in_transit && item.stages.size > 1 %]
-                                        <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
-                                    [% ELSE %]
-                                        <a class="btn btn-default btn-xs" disabled>
-                                    [% END %]
-                                        <i class="fa fa-arrow-right"></i>
-                                        Move to next stage
-                                    </a>
-                                    [% IF !in_transit %]
-                                        <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
-                                    [% ELSE %]
-                                        <a class="btn btn-default btn-xs" disabled>
-                                    [% END %]
-                                        <i class="fa fa-fire"></i>
-                                        [% IF item.stockrotationitem.indemand %]
-                                            Remove "In demand"
+                                            <i class="fa fa-arrow-right"></i>
+                                            Move to next stage
+                                        </a>
+                                        [% IF !in_transit %]
+                                            <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
                                         [% ELSE %]
-                                            Add "In demand"
+                                            <a class="btn btn-default btn-xs" disabled>
                                         [% END %]
-                                    </a>
-                                    [% IF !in_transit %]
-                                        <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
+                                            <i class="fa fa-fire"></i>
+                                            [% IF item.stockrotationitem.indemand %]
+                                                Remove "In demand"
+                                            [% ELSE %]
+                                                Add "In demand"
+                                            [% END %]
+                                        </a>
+                                        [% IF !in_transit %]
+                                            <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
+                                        [% ELSE %]
+                                            <a class="btn btn-default btn-xs" disabled>
+                                        [% END %]
+                                            <i class="fa fa-trash"></i>
+                                            Remove from rota
+                                        </a>
                                     [% ELSE %]
-                                        <a class="btn btn-default btn-xs" disabled>
+                                        <form class="rota_select_form" method="post" enctype="multipart/form-data">
+                                            <select class="item_select_rota" name="rota_id">
+                                                [% FOREACH rota IN rotas %]
+                                                    <option value="[% rota.rota_id | uri %]">[% rota.title | html %]</option>
+                                                [% END %]
+                                            </select>
+                                            <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-plus"></i> Add to rota</button>
+                                            <input type="hidden" name="op" value="add_item_to_rota" />
+                                            <input type="hidden" name="item_id" value="[% item.bib_item.id | uri %]" />
+                                            <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]" />
+                                        </form>
                                     [% END %]
-                                        <i class="fa fa-trash"></i>
-                                        Remove from rota
-                                    </a>
-                                [% ELSE %]
-                                    <form class="rota_select_form" method="post" enctype="multipart/form-data">
-                                        <select class="item_select_rota" name="rota_id">
-                                            [% FOREACH rota IN rotas %]
-                                                <option value="[% rota.rota_id | uri %]">[% rota.title | html %]</option>
-                                            [% END %]
-                                        </select>
-                                        <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-plus"></i> Add to rota</button>
-                                        <input type="hidden" name="op" value="add_item_to_rota" />
-                                        <input type="hidden" name="item_id" value="[% item.bib_item.id | uri %]" />
-                                        <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]" />
-                                    </form>
-                                [% END %]
-                            </td>
-                        </tr>
-                    [% END %]
-                </tbody>
-            </table>
+                                </td>
+                            </tr>
+                        [% END %]
+                    </tbody>
+                </table>
+            </div> <!-- /.page-section -->
         [% END %]
         [% IF !items || items.size == 0 %]
             <h1>No physical items for this record</h1>