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. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
2685ac2c6c
commit
85d9861fb3
2 changed files with 12 additions and 8 deletions
13
C4/Output.pm
13
C4/Output.pm
|
@ -109,7 +109,7 @@ 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 ) {
|
||||
|
@ -120,7 +120,7 @@ sub pagination_bar {
|
|||
. $url . '1'
|
||||
. $url_suffix
|
||||
. '"rel="start">'
|
||||
. '<i class="fa fa-fw fa-angle-double-left"></i> First'
|
||||
. '<i class="fa fa-fw fa-angle-double-left"></i> '
|
||||
. '</a></li>';
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ sub pagination_bar {
|
|||
. $previous
|
||||
. $url_suffix
|
||||
. '" rel="prev">'
|
||||
. '<i class="fa fa-fw fa-angle-left"></i> Previous'
|
||||
. '<i class="fa fa-fw fa-angle-left"></i> '
|
||||
. '</a></li>';
|
||||
}
|
||||
|
||||
|
@ -189,9 +189,7 @@ sub pagination_bar {
|
|||
. $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?
|
||||
|
@ -202,8 +200,7 @@ sub pagination_bar {
|
|||
. $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>';
|
||||
|
|
|
@ -431,6 +431,13 @@ $(document).ready(function () {
|
|||
if ($('[data-bs-toggle="tooltip"]').length) {
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
}
|
||||
|
||||
if ($(".pagination.output").length > 0) {
|
||||
$(".output.first").append(__("First"));
|
||||
$(".output.previous").append(__("Previous"));
|
||||
$(".output.next").prepend(__("Next"));
|
||||
$(".output.last").prepend(__("Last"));
|
||||
}
|
||||
});
|
||||
|
||||
function removeLastBorrower() {
|
||||
|
|
Loading…
Reference in a new issue