Bug 28453 - Update pagination subroutine to generate Bootstrap markup
Summary: Update pagination subroutine to generate Bootstrap markup
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-25 16:22 UTC by Owen Leonard
Modified: 2021-12-13 14:20 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 28453: Update pagination subroutine to generate Bootstrap markup (16.84 KB, patch)
2021-10-06 18:46 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28453: Update pagination subroutine to generate Bootstrap markup (15.81 KB, patch)
2021-10-25 14:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28453: DO NOT PUSH - FOR MARC21 TESTING ONLY (2.55 KB, patch)
2021-10-25 14:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28453: Update pagination subroutine to generate Bootstrap markup (15.86 KB, patch)
2021-10-25 19:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 28453: DO NOT PUSH - FOR MARC21 TESTING ONLY (2.60 KB, patch)
2021-10-25 19:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 28453: (follow-up) Make pagination labels translatable (3.71 KB, patch)
2021-11-02 11:25 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-05-25 16:22:28 UTC
Many places in Koha use a subroutine in Output.pm, "pagination_bar" to generate pagination menus. These end up looking very different from some other pagination menus in Koha, particularly the one on the catalog search results page.

Bug 18008 proposed to move more of the markup-generation into the template, which I think is the right solution. That bug has been stalled for a while now, so I'd like to make an interim change until that can get some attention again.
Comment 1 Owen Leonard 2021-10-06 18:46:34 UTC Comment hidden (obsolete)
Comment 2 David Nind 2021-10-25 00:11:18 UTC
Things noted from testing:

- Administration -> Record matching rules: with 30 entries the pagination bar didn't appear (both before and after the patch was applied) - I'm assuming it should have kicked in at 20?

- Cataloging -> MARC Editor -> Tag using unimarc_field_210c value builder: this worked after patch applied (before the patch was applied I couldn't get any results). However, when you click on the controls for anything after page 1, it says no results (even when there are more than 20 results).

- Tools > Comments: The pagination only appears at the bottom - should this be added at the top as well?
Comment 3 Owen Leonard 2021-10-25 14:37:22 UTC
Created attachment 126836 [details] [review]
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.
Comment 4 Owen Leonard 2021-10-25 14:37:25 UTC
Created attachment 126837 [details] [review]
Bug 28453: DO NOT PUSH - FOR MARC21 TESTING ONLY

This patch changes the authority type searched by the UNIMARC 210$c
plugin from EDITORS to PERSO_NAME in order to try to make it more easily
testable by MARC21 users.

FOR TESTING ONLY!!
Comment 5 Owen Leonard 2021-10-25 14:41:21 UTC
(In reply to David Nind from comment #2)
> - Administration -> Record matching rules

This was an error in my test plan. It is one of the pages which had unused pagination markup in the template.

> - Cataloging -> MARC Editor -> Tag using unimarc_field_210c value builder:
> this worked after patch applied

I'm glad you caught this because I made a "temporary" change which ended up in the patch. In order to test using my MARC21 data I altered the search to use PERSO_NAME instead of EDITORS. This is now in the DO NOT PUSH patch which will enable testing of the pagination bar if you have PERSO_NAME authorities.

> - Tools > Comments: The pagination only appears at the bottom - should this
> be added at the top as well?

I thought the same, but I didn't want to make any additions in this patch.
Comment 6 David Nind 2021-10-25 19:29:47 UTC
Created attachment 126845 [details] [review]
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>
Comment 7 David Nind 2021-10-25 19:29:52 UTC
Created attachment 126846 [details] [review]
Bug 28453: DO NOT PUSH - FOR MARC21 TESTING ONLY

This patch changes the authority type searched by the UNIMARC 210$c
plugin from EDITORS to PERSO_NAME in order to try to make it more easily
testable by MARC21 users.

FOR TESTING ONLY!!

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2021-10-25 19:30:32 UTC
Thanks Owen for fixing and clarifying - signed off now!
Comment 9 Katrin Fischer 2021-11-01 12:54:27 UTC
I am sorry, but I believe there are some translation issues hiding here.

In Output.pm:
+              . '<i class="fa fa-fw fa-angle-double-left"></i> First' . '</a></li>';
+              . '" rel="prev">' . '<i class="fa fa-fw fa-angle-left"></i> Previous' . '</a></li>';
. '" rel="next">' . 'Next <i class="fa fa-fw fa-angle-right"></i>' . '</a></li>';
Comment 10 Owen Leonard 2021-11-02 11:25:25 UTC
Created attachment 127210 [details] [review]
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.
Comment 11 Jonathan Druart 2021-12-13 14:20:06 UTC
Owen, it seems that you needs to adjust the two occurrences at the OPAC as well:

opac/opac-authorities-home.pl:        pagination_bar => pagination_bar(

opac/opac-shelves.pl:                    pagination_bar => pagination_bar(
opac/opac-shelves.pl:        pagination_bar => pagination_bar(