Bugzilla – Attachment 126845 Details for
Bug 28453
Update pagination subroutine to generate Bootstrap markup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28453: Update pagination subroutine to generate Bootstrap markup
Bug-28453-Update-pagination-subroutine-to-generate.patch (text/plain), 15.86 KB, created by
David Nind
on 2021-10-25 19:29:47 UTC
(
hide
)
Description:
Bug 28453: Update pagination subroutine to generate Bootstrap markup
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-10-25 19:29:47 UTC
Size:
15.86 KB
patch
obsolete
>From 202110030e19aba02b85c7ec9c22492816fea381 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 = '<ul class="pagination">'; > # link to first page? > if ( $current_page > 1 ) { > $pagination_bar .= >- "\n" . ' ' >- . '<a href="' >+ "\n" . '' >+ . '<li><a class="nav" href="' > . $url > . '1' > . $url_suffix > . '"rel="start">' >- . '<<' . '</a>'; >- } >- else { >- $pagination_bar .= >- "\n" . ' <span class="inactive"><<</span>'; >+ . '<i class="fa fa-fw fa-angle-double-left"></i> First' . '</a></li>'; > } > > # link on previous page ? >@@ -129,16 +125,12 @@ sub pagination_bar { > my $previous = $current_page - 1; > > $pagination_bar .= >- "\n" . ' ' >- . '<a href="' >+ "\n" . '' >+ . '<li><a class="nav" href="' > . $url > . $previous > . $url_suffix >- . '" rel="prev">' . '<' . '</a>'; >- } >- else { >- $pagination_bar .= >- "\n" . ' <span class="inactive"><</span>'; >+ . '" rel="prev">' . '<i class="fa fa-fw fa-angle-left"></i> Previous' . '</a></li>'; > } > > my $min_to_display = $current_page - $pages_around; >@@ -157,25 +149,25 @@ sub pagination_bar { > and $last_displayed_page != $page_number - 1 ) > { > $pagination_bar .= >- "\n" . ' <span class="inactive">...</span>'; >+ "\n" . '<li><span class="inactive">...</span></li>'; > } > > if ( $page_number == $current_page ) { > $pagination_bar .= >- "\n" . ' ' >- . '<span class="currentPage">' >+ "\n" . '' >+ . '<li class="active"><span>' > . $page_number >- . '</span>'; >+ . '</span></li>'; > } > else { > $pagination_bar .= >- "\n" . ' ' >- . '<a href="' >+ "\n" . '' >+ . '<li><a class="nav" href="' > . $url > . $page_number > . $url_suffix > . '">' >- . $page_number . '</a>'; >+ . $page_number . '</a></li>'; > } > $last_displayed_page = $page_number; > } >@@ -186,31 +178,25 @@ sub pagination_bar { > my $next = $current_page + 1; > > $pagination_bar .= "\n" >- . ' <a href="' >+ . '<li><a class="nav" href="' > . $url > . $next > . $url_suffix >- . '" rel="next">' . '>' . '</a>'; >- } >- else { >- $pagination_bar .= >- "\n" . ' <span class="inactive">></span>'; >+ . '" rel="next">' . 'Next <i class="fa fa-fw fa-angle-right"></i>' . '</a></li>'; > } > > # link to last page? > if ( $current_page != $nb_pages ) { > $pagination_bar .= "\n" >- . ' <a href="' >+ . '<li><a class="nav" href="' > . $url > . $nb_pages > . $url_suffix > . '" rel="last">' >- . '>>' . '</a>'; >- } >- else { >- $pagination_bar .= >- "\n" . ' <span class="inactive">>></span>'; >+ . 'Last <i class="fa fa-fw fa-angle-double-right"></i>' . '</a></li>'; > } >+ >+ $pagination_bar .= "\n" . '</ul>'; > } > > 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 @@ > <p>There are no saved matching rules.</p> > [% END # /IF ( available_matching_rules ) %] > >- <div class="pages">[% pagination_bar | $raw %]</div> > [% 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 > <p>There are no saved patron attribute types.</p> > [% END %] > >-<div class="pages">[% pagination_bar | $raw %]</div> >- > [% END %] > > </main> >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 @@ > > <div id="merge_in_progress"></div> > [% IF ( total ) %] >-<div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_top"> >+ [% pagination_bar | $raw %] >+ </nav> > > <p id="authorities_searchresultlist_current_page_info"> > Results [% from | html %] to [% to | html %] of [% total | html %] >@@ -86,7 +89,9 @@ > </table> > </div> > >-<div class="pages">[% pagination_bar | $raw %]</div> >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> > > [% 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, > <a href="#searchresult-breeding">[% breeding_count | html %] result(s) found in reservoir</a> > </div> >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_top"> >+ [% pagination_bar | $raw %] >+ </nav> >+ > <div class="searchresults"> > <table> > <tr> >@@ -180,7 +184,11 @@ > </tr> > [% END # /FOREACH resultsloo %] > </table> >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> >+ > </div> <!-- /.searchresults --> > [% 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 @@ > </fieldset> > </form> > [% IF ( total ) %] >- <h3>Authority search results</h3> >- <div class="pages"> >- [% pagination_bar | $raw %] >- </div>[% END %] >+ <h3>Authority search results</h3> >+ <nav class="pages" id="pagination_top"> >+ [% pagination_bar | $raw %] >+ </nav> >+ [% END %] > <p> > [% IF ( total ) %] > <strong>Results [% from | html %] to [% to | html %] of [% total | html %]</strong><br /><br /> >@@ -68,10 +69,10 @@ > <td>[% resul.summary.label | html %]</td> > <td>[% resul.used | html %] times</td> > <td> >- [% IF ( resul.to_report ) %] >+ [% #IF ( resul.to_report ) %] > <button class="choosebt">Choose</button> > <p class="toreport" style="display:none">[% resul.to_report |replace('\n', '\\n') |replace('\r', '\\r') |html %]</p> >- [% END %] >+ [% #END %] > </td> > </tr> > [% END %] >@@ -79,9 +80,10 @@ > </div> > [% END %] > >- [% IF ( total ) %]<div class="pages"> >- [% pagination_bar | $raw %] >- </div> >+ [% IF ( total ) %] >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> > [% END %] > > <!-- Authority details modal --> >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 %] > </table> > [% END %] >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> > > [% 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 @@ > </tr> > [% END %]</tbody> > </table> >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> >+ > [% ELSE %] > [% IF ( status ) %]<p><strong>No comments have been approved.</strong></p>[% ELSE %]<p><strong>No comments to moderate.</strong></p>[% 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 %] > </div> > [% END %] >- [% IF ( pagination_bar ) %] >- <div class="pages" id="pagination_top"> >- [% pagination_bar | $raw %] >- </div> >- [% END %] >+ > [% IF ( tagloop ) %] > <p class="check"></p> > <table id="tagst"> >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 %] > > <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3> >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_top"> >+ [% pagination_bar | $raw %] >+ </nav> >+ > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post"> > <input type="hidden" name="op" value="remove_biblios" /> > <input type="hidden" name="referer" value="view" /> >@@ -307,7 +311,11 @@ > </tr> > [% END %]<!-- /itemsloop --> > </table> >- <div class="pages">[% pagination_bar | $raw %]</div> >+ >+ <nav class="pages" id="pagination_bottom"> >+ [% pagination_bar | $raw %] >+ </nav> >+ > </form> > > [% END %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28453
:
125849
|
126836
|
126837
|
126845
|
126846
|
127210
|
171076
|
171077
|
171078
|
171150
|
175272
|
175273
|
175274
|
175279
|
175280
|
175281
|
176663
|
176664
|
176665
|
176666
|
176667