Bugzilla – Attachment 127210 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: (follow-up) Make pagination labels translatable
Bug-28453-follow-up-Make-pagination-labels-transla.patch (text/plain), 3.71 KB, created by
Owen Leonard
on 2021-11-02 11:25:25 UTC
(
hide
)
Description:
Bug 28453: (follow-up) Make pagination labels translatable
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-11-02 11:25:25 UTC
Size:
3.71 KB
patch
obsolete
>From 15da7cdc863970eb7f56051d106dde7d45ffaf0a Mon Sep 17 00:00:00 2001 >From: Owen <oleonard@myacpl.org> >Date: Tue, 2 Nov 2021 11:12:50 +0000 >Subject: [PATCH] Bug 28453: (follow-up) Make pagination labels translatable > >This patch moves the English strings out of Output.pm and adds classes >to the pagination markup which can be used as hooks for JavaScript. The >global JS include is modified to look for these hooks and add text >labels to the links. >--- > C4/Output.pm | 18 +++++++++--------- > .../intranet-tmpl/prog/js/staff-global.js | 6 ++++++ > 2 files changed, 15 insertions(+), 9 deletions(-) > >diff --git a/C4/Output.pm b/C4/Output.pm >index 643f54cc49..949da4e2c8 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -107,17 +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">'; >+ $pagination_bar = '<ul class="pagination output">'; > # link to first page? > if ( $current_page > 1 ) { > $pagination_bar .= > "\n" . '' >- . '<li><a class="nav" href="' >+ . '<li><a class="nav output first" href="' > . $url > . '1' > . $url_suffix > . '"rel="start">' >- . '<i class="fa fa-fw fa-angle-double-left"></i> First' . '</a></li>'; >+ . '<i class="fa fa-fw fa-angle-double-left"></i></a></li>'; > } > > # link on previous page ? >@@ -126,11 +126,11 @@ sub pagination_bar { > > $pagination_bar .= > "\n" . '' >- . '<li><a class="nav" href="' >+ . '<li><a class="nav output previous" href="' > . $url > . $previous > . $url_suffix >- . '" rel="prev">' . '<i class="fa fa-fw fa-angle-left"></i> Previous' . '</a></li>'; >+ . '" rel="prev"><i class="fa fa-fw fa-angle-left"></i></a></li>'; > } > > my $min_to_display = $current_page - $pages_around; >@@ -178,22 +178,22 @@ sub pagination_bar { > my $next = $current_page + 1; > > $pagination_bar .= "\n" >- . '<li><a class="nav" href="' >+ . '<li><a class="nav output next" href="' > . $url > . $next > . $url_suffix >- . '" rel="next">' . 'Next <i class="fa fa-fw fa-angle-right"></i>' . '</a></li>'; >+ . '" rel="next"><i class="fa fa-fw fa-angle-right"></i></a></li>'; > } > > # link to last page? > if ( $current_page != $nb_pages ) { > $pagination_bar .= "\n" >- . '<li><a class="nav" href="' >+ . '<li><a class="nav output last" href="' > . $url > . $nb_pages > . $url_suffix > . '" rel="last">' >- . 'Last <i class="fa fa-fw fa-angle-double-right"></i>' . '</a></li>'; >+ . '<i class="fa fa-fw fa-angle-double-right"></i></a></li>'; > } > > $pagination_bar .= "\n" . '</ul>'; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index c62a037e52..b9cca416b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -166,6 +166,12 @@ $(document).ready(function() { > resetSearchContext(); > }); > >+ if( $(".pagination.output").length > 0 ){ >+ $(".output.first").append( __("First") ); >+ $(".output.previous").append( __("Previous") ); >+ $(".output.next").prepend( __("Next") ); >+ $(".output.last").prepend( __("Last") ); >+ } > }); > > function removeLastBorrower(){ >-- >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