From 3a093aa4de2170a8a8f20a65d77654ed9bd58724 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 14 Jun 2024 18:06:15 +0000 Subject: [PATCH] Bug 28453: Update pagination subroutine to generate Bootstrap markup This patch modifies Output.pm to change the HTML it generates when creating pagination bars. The changes allow the pagination menu to be styled like Bootstrap pagination, making them consistent with the pagination on catalog search results. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Test pages where the pagination_bar subroutine is called: - Authorities -> Authority search results. - Cataloging -> Cataloging search results. - Cataloging -> MARC Editor -> Edit tag which is configured to use the unimarc_field_210c value builder. - Reports -> Saved SQL reports -> Results. - Tools -> Comments. - Lists -> List contents. The pagination bar markup was removed from the templates for these pages because it wasn't being used: - Administration -> Patron attribute types. - Administration -> Record matching rules. - Tools -> Tags. --- C4/Output.pm | 54 +++++++------------ .../prog/css/src/staff-global.scss | 36 ------------- .../prog/en/modules/admin/matching-rules.tt | 2 - .../en/modules/admin/patron-attr-types.tt | 2 - .../modules/authorities/searchresultlist.tt | 8 ++- .../prog/en/modules/cataloguing/addbooks.tt | 16 +++--- .../value_builder/unimarc_field_210c.tt | 18 ++++--- .../modules/reports/guided_reports_start.tt | 8 +-- .../prog/en/modules/reviews/reviewswaiting.tt | 6 ++- .../prog/en/modules/virtualshelves/shelves.tt | 10 +++- 10 files changed, 64 insertions(+), 96 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index d8ea0bfb52..90fbad510b 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -110,21 +110,17 @@ sub pagination_bar { # navigation bar useful only if more than one page to display ! if ( $nb_pages > 1 ) { - + $pagination_bar = ''; } return $pagination_bar; diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 2bc5c5db27..d25c3d86a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -648,42 +648,6 @@ div { } } - &.pages { - margin: .5em 0; - - a { - font-weight: bold; - padding: 1px 5px; - text-decoration: none; - - &:link, - &:visited { - background-color: #EEEEEE; - color: #3366CC; - } - - &:hover, - &:active { - background-color: #FFC; - } - } - - .current, - .currentPage { - background-color: #E6FCB7; - color: #666; - font-weight: bold; - padding: 1px 5px; - } - - .inactive { - background-color: #F3F3F3; - color: #BCBCBC; - font-weight: bold; - padding: 1px 5px; - } - } - .browse { margin: .5em 0; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt index 0de0a22dc8..b838870e01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt @@ -482,8 +482,6 @@ [% ELSE %]

There are no saved matching rules.

[% END # /IF ( available_matching_rules ) %] - -
[% pagination_bar | $raw %]
[% END # /IF ( display_list ) %] [% IF ( matching_rule_form ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index 5e846dc3e4..ecc7408d16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -390,8 +390,6 @@

There are no saved patron attribute types.

[% END %] -
[% pagination_bar | $raw %]
- [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt index ec06c0d065..ed9a9469ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -54,7 +54,9 @@ [% END %] [% IF ( total ) %] -
[% pagination_bar | $raw %]
+

Results [% from | html %] to [% to | html %] of [% total | html %] @@ -141,7 +143,9 @@ [% INCLUDE 'authority-detail-modal.inc' %] -

[% pagination_bar | $raw %]
+ [% ELSE %] No results found diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index 9e4b2c6fb3..092a0e6b6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -94,11 +94,13 @@ [% IF ( total ) %]

Records found in the catalog

-
- [% total | html %] result(s) found in catalog, - [% breeding_count | html %] result(s) found in reservoir -
-
[% pagination_bar | $raw %]
+
+ [% total | html %] result(s) found in catalog, + [% breeding_count | html %] result(s) found in reservoir +
+
@@ -186,7 +188,9 @@ [% END # /FOREACH resultsloo %]
-
[% pagination_bar | $raw %]
+
[% ELSE # IF total %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt index f1b9cd0eda..f578b2fa36 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt @@ -22,7 +22,7 @@ - + @@ -48,10 +48,11 @@ [% IF ( total ) %] -

Authority search results

-
- [% pagination_bar | $raw %] -
[% END %] +

Authority search results

+ + [% END %]

[% IF ( total ) %]  Results [% from | html %] to [% to | html %] of [% total | html %]

@@ -85,9 +86,10 @@ [% END %] - [% IF ( total ) %]

- [% pagination_bar | $raw %] -
+ [% IF ( total ) %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index ed1e0cf7de..f0cd92e9f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1154,9 +1154,9 @@ [% END # /IF batch operations || ( unlimited_total > 10 && limit <= 1000 ) %] -
+
+ [% END # UNLESS ( errors ) %] [% END # IF ( execute ) %] @@ -1236,7 +1236,9 @@ [% END %] -
[% pagination_bar | $raw %]
+ [% INCLUDE 'chart.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt index 9892df26f6..67394dc8ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt @@ -122,7 +122,11 @@ [% END %] -
[% pagination_bar | $raw %]
+ + + [% ELSE %] [% IF ( status ) %]

No comments have been approved.

[% ELSE %]

No comments to moderate.

[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index b45e98237e..648b0f1f38 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -242,7 +242,11 @@ [% IF itemsloop %] [% SET contents = shelf.get_contents %] [% IF ( contents.count ) %]

This list contains [% contents.count | html %] titles

[% END %] -
[% pagination_bar | $raw %]
+ + +
[% INCLUDE 'csrf-token.inc' %] @@ -388,7 +392,9 @@ -
[% pagination_bar | $raw %]
+
[% END # /IF itemsloop %] [% END # /IF op == 'view' %] -- 2.39.2