From ee1d5ea15a05cbcc49c1f9aa0b3926fed39d6b6a Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Thu, 17 Nov 2022 19:28:48 +0000
Subject: [PATCH] Bug 32238: Add page-section to label creator pages

This patch modifies two label creator templates so that a .page-section
container is used to wrap main content.

To test, apply the patch and go to Cataloging -> Label creator.

 - Click Manage -> Label batches.
   - The display of existing batches should look correct.
 - Click "Edit" on one of the label batches.
   - If necessary, submit a set of barcodes or item numbers to add to
     the batch.
   - The display of items in the table of items should look correct.
---
 .../en/modules/labels/label-edit-batch.tt     | 99 ++++++++++---------
 .../prog/en/modules/labels/label-manage.tt    | 85 ++++++++--------
 2 files changed, 95 insertions(+), 89 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
index 28da22b91b..4e7d98d776 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
@@ -137,56 +137,59 @@
                             [% IF ( table_loop ) %]
                                 <form name="items">
                                     <h2>Items in batch number [% batch_id | html %]</h2>
-                                    <table id="batcht">
-                                        [% FOREACH table_loo IN table_loop %]
-                                            [% IF ( table_loo.header_fields ) %]
-                                                <thead>
-                                                    <tr>
-                                                        [% FOREACH header_field IN table_loo.header_fields %]
-                                                            [% SWITCH header_field.field_label -%]
-                                                                [% CASE "Label number" -%]
-                                                                    <th>Label number</th>
-                                                                [% CASE "Summary" -%]
-                                                                    <th class="anti-the">Summary</th>
-                                                                [% CASE "Item type" %]
-                                                                    <th>Item type</th>
-                                                                [% CASE "Call number" %]
-                                                                    <th>Call number</th>
-                                                                [% CASE "Barcode" %]
-                                                                    <th>Barcode</th>
-                                                                [% CASE "Select" -%]
-                                                                    <th>Select</th>
-                                                                [% CASE %]
-                                                                    <th>[% header_field.field_label | html %]</th>
-                                                            [% END -%]
-                                                        [% END %]
-                                                    </tr>
-                                                </thead>
-                                                <tbody>
-                                            [% ELSE %]
-                                                    <tr>
-                                                        [% FOREACH text_field IN table_loo.text_fields %]
-                                                            [% IF ( text_field.select_field ) %]
-                                                                <td>
-                                                                    <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=[% batch_id |url %]&amp;label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a>
-                                                                    <a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id | html %]" data-label-id="[% text_field.field_value | html %]"><i class="fa fa-share-square-o"></i> Export</a>
-                                                                </td>
-                                                                <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]"></td>
-                                                            [% ELSE %]
-                                                                <td>
-                                                                    [% IF ( text_field.field_name == '_item_type_tbl' ) %]
-                                                                        [% ItemTypes.GetDescription( text_field.field_value ) | html %]
-                                                                    [% ELSE %]
-                                                                        [% text_field.field_value | $raw %]
-                                                                    [% END %]
-                                                                </td>
+
+                                    <div class="page-section">
+                                        <table id="batcht">
+                                            [% FOREACH table_loo IN table_loop %]
+                                                [% IF ( table_loo.header_fields ) %]
+                                                    <thead>
+                                                        <tr>
+                                                            [% FOREACH header_field IN table_loo.header_fields %]
+                                                                [% SWITCH header_field.field_label -%]
+                                                                    [% CASE "Label number" -%]
+                                                                        <th>Label number</th>
+                                                                    [% CASE "Summary" -%]
+                                                                        <th class="anti-the">Summary</th>
+                                                                    [% CASE "Item type" %]
+                                                                        <th>Item type</th>
+                                                                    [% CASE "Call number" %]
+                                                                        <th>Call number</th>
+                                                                    [% CASE "Barcode" %]
+                                                                        <th>Barcode</th>
+                                                                    [% CASE "Select" -%]
+                                                                        <th>Select</th>
+                                                                    [% CASE %]
+                                                                        <th>[% header_field.field_label | html %]</th>
+                                                                [% END -%]
+                                                            [% END %]
+                                                        </tr>
+                                                    </thead>
+                                                    <tbody>
+                                                [% ELSE %]
+                                                        <tr>
+                                                            [% FOREACH text_field IN table_loo.text_fields %]
+                                                                [% IF ( text_field.select_field ) %]
+                                                                    <td>
+                                                                        <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=[% batch_id |url %]&amp;label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a>
+                                                                        <a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id | html %]" data-label-id="[% text_field.field_value | html %]"><i class="fa fa-share-square-o"></i> Export</a>
+                                                                    </td>
+                                                                    <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]"></td>
+                                                                [% ELSE %]
+                                                                    <td>
+                                                                        [% IF ( text_field.field_name == '_item_type_tbl' ) %]
+                                                                            [% ItemTypes.GetDescription( text_field.field_value ) | html %]
+                                                                        [% ELSE %]
+                                                                            [% text_field.field_value | $raw %]
+                                                                        [% END %]
+                                                                    </td>
+                                                                [% END %]
                                                             [% END %]
-                                                        [% END %]
-                                                    </tr>
+                                                        </tr>
+                                                [% END %]
                                             [% END %]
-                                        [% END %]
-                                        </tbody>
-                                    </table>
+                                            </tbody>
+                                        </table>
+                                    </div> <!-- /.page-section -->
                                 </form>
                                 [% ELSE %]
                                     <div class="dialog message">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
index 49ea572bb2..01d1c0c993 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
@@ -71,51 +71,54 @@
                             [% ELSIF ( label_element == 'batch' ) %]
                             <h2>Currently available batches</h2>
                             [% END %]
-                            <table id="labels-table">
-                                [% FOREACH table_loo IN table_loop %]
-                                    [% IF ( table_loo.header_fields ) %]
-                                        <thead>
-                                        <tr>
-                                            [% FOREACH header_field IN table_loo.header_fields %]
-                                                [% SWITCH header_field.field_label %]
-                                                    [% CASE 'Layout ID'       %]<th>Layout ID</th>
-                                                    [% CASE 'Layout'          %]<th>Layout</th>
-                                                    [% CASE 'Barcode Type'    %]<th>Barcode type</th>
-                                                    [% CASE 'Print Type'      %]<th>Print type</th>
-                                                    [% CASE 'Template ID'     %]<th>Template ID</th>
-                                                    [% CASE 'Template Name'   %]<th>Template name</th>
-                                                    [% CASE 'Description'     %]<th>Description</th>
-                                                    [% CASE 'Actions'         %]<th class="noExport">Actions</th>
-                                                    [% CASE 'Profile ID'      %]<th>Profile ID</th>
-                                                    [% CASE 'Printer Name'    %]<th>Printer name</th>
-                                                    [% CASE 'Paper Bin'       %]<th>Paper bin</th>
-                                                    [% CASE 'Batch ID'        %]<th>Batch ID</th>
-                                                    [% CASE 'Item Count'      %]<th>Item count</th>
-                                                    [% CASE 'Fields to Print' %]<th>Fields to print</th>
-                                                    [% CASE                   %]<th>[% header_field.field_label | html %]</th>
+
+                            <div class="page-section">
+                                <table id="labels-table">
+                                    [% FOREACH table_loo IN table_loop %]
+                                        [% IF ( table_loo.header_fields ) %]
+                                            <thead>
+                                            <tr>
+                                                [% FOREACH header_field IN table_loo.header_fields %]
+                                                    [% SWITCH header_field.field_label %]
+                                                        [% CASE 'Layout ID'       %]<th>Layout ID</th>
+                                                        [% CASE 'Layout'          %]<th>Layout</th>
+                                                        [% CASE 'Barcode Type'    %]<th>Barcode type</th>
+                                                        [% CASE 'Print Type'      %]<th>Print type</th>
+                                                        [% CASE 'Template ID'     %]<th>Template ID</th>
+                                                        [% CASE 'Template Name'   %]<th>Template name</th>
+                                                        [% CASE 'Description'     %]<th>Description</th>
+                                                        [% CASE 'Actions'         %]<th class="noExport">Actions</th>
+                                                        [% CASE 'Profile ID'      %]<th>Profile ID</th>
+                                                        [% CASE 'Printer Name'    %]<th>Printer name</th>
+                                                        [% CASE 'Paper Bin'       %]<th>Paper bin</th>
+                                                        [% CASE 'Batch ID'        %]<th>Batch ID</th>
+                                                        [% CASE 'Item Count'      %]<th>Item count</th>
+                                                        [% CASE 'Fields to Print' %]<th>Fields to print</th>
+                                                        [% CASE                   %]<th>[% header_field.field_label | html %]</th>
+                                                    [% END %]
+                                                [% END %]
+                                            </tr>
+                                            </thead>
+                                        [% ELSE %]
+                                            <tr>
+                                            [% FOREACH text_field IN table_loo.text_fields %]
+                                                [% IF ( text_field.select_field ) %]
+                                                    <td class="actions">
+                                                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-edit"></i> Edit</a>
+                                                        <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=[% label_element | html %]&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a>
+                                                    </td>
+                                                    [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
+                                                [% ELSIF ( text_field.field_value ) %]
+                                                    <td>[% text_field.field_value | html %]</td>
+                                                [% ELSE %]
+                                                    <td>&nbsp;</td>
                                                 [% END %]
                                             [% END %]
-                                        </tr>
-                                        </thead>
-                                    [% ELSE %]
-                                        <tr>
-                                        [% FOREACH text_field IN table_loo.text_fields %]
-                                            [% IF ( text_field.select_field ) %]
-                                                <td class="actions">
-                                                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-edit"></i> Edit</a>
-                                                    <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=[% label_element | html %]&amp;element_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a>
-                                                </td>
-                                                [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
-                                            [% ELSIF ( text_field.field_value ) %]
-                                                <td>[% text_field.field_value | html %]</td>
-                                            [% ELSE %]
-                                                <td>&nbsp;</td>
-                                            [% END %]
+                                            </tr>
                                         [% END %]
-                                        </tr>
                                     [% END %]
-                                [% END %]
-                            </table>
+                                </table>
+                            </div> <!-- /.page-section -->
                             [% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
                             </fieldset>
                             </form>
-- 
2.20.1