Bug 23094: Use Bootstrap-style pagination on staged MARC records page
authorOwen Leonard <oleonard@myacpl.org>
Wed, 26 Jun 2019 14:57:18 +0000 (14:57 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 15 Jul 2019 10:28:06 +0000 (11:28 +0100)
This patch makes markup changes in order to make the pagination links on
the staged MARC records page consistent with the links on the catalog
search results page.

To test properly you should have enough staged marc record batches that
there are multiple pages to list.

Go to Tools -> Manage staged MARC records. Test that the pagination
links look consistent with the catalog search results page and that they
work correctly.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt

index 13b0309..277e1bf 100644 (file)
 
                     [% IF ( batch_list ) %]
                         [% IF ( pages ) %]
-                            <div class="pages">
-                                [% FOREACH page IN pages %]
-                                    [% IF ( page.current_page ) %]
-                                        <span class="current">[% page.page_number | html %]</span>
-                                    [% ELSE %]
-                                        <a href="[% page.script_name | url %]?offset=[% page.offset | uri %]">[% page.page_number | html %]</a>
-                                    [% END %]
-                                [% END %]
-                            </div>
+                            [% PROCESS pagination %]
                         [% END %]
 
                         <table>
                         </table>
 
                         [% IF ( pages ) %]
-                            <div class="pages">
-                                [% FOREACH page IN pages %]
-                                    [% IF ( page.current_page ) %]
-                                        <span class="current">[% page.page_number | html %]</span>
-                                    [% ELSE %]
-                                        <a href="[% page.script_name | url %]?offset=[% page.offset | uri %]">[% page.page_number | html %]</a>
-                                    [% END %]
-                                [% END %]
-                            </div>
+                            [% PROCESS pagination %]
                         [% END %]
                     [% END # /IF batch_lis %]
 
     </script>
 [% END %]
 [% INCLUDE 'intranet-bottom.inc' %]
+[% BLOCK pagination %]
+    <nav>
+        <ul class="pagination">
+            [% FOREACH page IN pages %]
+                [% IF ( page.current_page && page.page_number > 1 ) %]
+                    <li><a href="[% page.script_name | url %]?offset=0" class="nav"><i class="fa fa-fw fa-angle-double-left"></i> First</a></li>
+                    <li><a href="[% page.script_name | url %]?offset=[% offset - results_per_page | uri %]"><i class="fa fa-fw fa-angle-left"></i> Previous</a></li>
+                [% END %]
+            [% END %]
+            [% FOREACH page IN pages %]
+                [% IF ( page.current_page ) %]
+                    [% SET current_page = page.page_number %]
+                    <li class="active"><span class="current">[% page.page_number | html %]</span></li>
+                [% ELSE %]
+                    <li><a class="nav" href="[% page.script_name | url %]?offset=[% page.offset | uri %]">[% page.page_number | html %]</a></li>
+                [% END %]
+            [% END %]
+            [% IF ( current_page < pages.size() ) %]
+                <li>
+                    <a href="[% page.script_name | url %]?offset=[% offset + results_per_page | uri %]" class="nav">Next <i class="fa fa-fw fa-angle-right"></i></a>
+                </li>
+                <li>
+                    <a href="[% page.script_name | url %]?offset=[% ( results_per_page * ( pages.size - 1 ) ) | uri %]" class="nav">Last <i class="fa fa-fw fa-angle-double-right"></i></a>
+                </li>
+            [% END %]
+        </ul>
+    </nav>
+[% END %]
\ No newline at end of file