From 2c07e5b5327408253639a61618c8871aac2ba60a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 25 Oct 2021 14:24:21 +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 | 40 ++------------ .../prog/en/modules/admin/matching-rules.tt | 1 - .../en/modules/admin/patron-attr-types.tt | 2 - .../modules/authorities/searchresultlist.tt | 9 +++- .../prog/en/modules/cataloguing/addbooks.tt | 12 ++++- .../value_builder/unimarc_field_210c.tt | 20 +++---- .../modules/reports/guided_reports_start.tt | 5 +- .../prog/en/modules/reviews/reviewswaiting.tt | 6 ++- .../prog/en/modules/tags/review.tt | 6 +-- .../prog/en/modules/virtualshelves/shelves.tt | 12 ++++- 11 files changed, 72 insertions(+), 95 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 09dc73d41d..643f54cc49 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -107,21 +107,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 df2354cad2..c942614ce9 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1239,42 +1239,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; } @@ -3212,6 +3176,10 @@ nav { } } + &.pages { + font-size: 90%; + } + } 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 06983048ec..ff48d9c398 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 @@ -478,7 +478,6 @@

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 b57890ace2..4e923944d8 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 @@ -352,8 +352,6 @@ Patron attribute types › Administration › Koha

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 3baec6db23..22ca1ff556 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -35,7 +35,10 @@
[% IF ( total ) %] -
[% pagination_bar | $raw %]
+ +

Results [% from | html %] to [% to | html %] of [% total | html %] @@ -86,7 +89,9 @@ -

[% 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 ef8e4fa2c8..4b2e281e2c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -93,7 +93,11 @@ [% total | html %] result(s) found in catalog, [% breeding_count | html %] result(s) found in reservoir -
[% pagination_bar | $raw %]
+ + +
@@ -180,7 +184,11 @@ [% END # /FOREACH resultsloo %]
-
[% pagination_bar | $raw %]
+ + +
[% ELSE # IF total %] [% IF ( query ) %] 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 af3b92d7d3..04787c7236 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 @@ -42,10 +42,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 %]

@@ -68,10 +69,10 @@ [% resul.summary.label | html %] [% resul.used | html %] times - [% IF ( resul.to_report ) %] + [% #IF ( resul.to_report ) %]

- [% END %] + [% #END %] [% END %] @@ -79,9 +80,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 47ed17190c..02417e7125 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 @@ -1115,7 +1115,10 @@ [% END %] [% 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 ef01a2b3c1..c0ec1c06f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt @@ -81,7 +81,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/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index 1aae1a0b77..4b62c2c568 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -80,11 +80,7 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% END %] [% END %] - [% IF ( pagination_bar ) %] -
- [% pagination_bar | $raw %] -
- [% END %] + [% IF ( tagloop ) %]

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 b2f12a4b4e..19064aaeda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -186,7 +186,11 @@ [% IF itemsloop %]

Contents of [% shelf.shelfname | html %]

-
[% pagination_bar | $raw %]
+ + + @@ -307,7 +311,11 @@ [% END %]
-
[% pagination_bar | $raw %]
+ + + [% END %] -- 2.20.1