Bug 23915

Summary: Replace OPAC list sort menu with Bootstrap menu button
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, david, lucas, testopia
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This patch adds JavaScript to the list contents page which converts the resort form's <select> menu into a Bootstrap dropdown menu. This allows for a more compact and consistent display.
Version(s) released in:
20.05.00
Bug Depends on: 23913    
Bug Blocks: 24996    
Attachments: Screenshot showing the new menu button (in its active state)
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button

Description Owen Leonard 2019-10-28 17:49:44 UTC
Created attachment 94816 [details]
Screenshot showing the new menu button (in its active state)

After consolidating the menus in Bug 23913, the structure of the resort form lends itself to being replaced, via JavaScript with a Bootstrap menu button. This allows for a more compact toolbar.
Comment 1 Owen Leonard 2019-10-28 18:13:19 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2019-12-09 15:41:54 UTC
Owen,

This is by far better than the old form! I have two comments:

1. When you pull up the new dropdown I think the .dropdown-header classes look a bit off. Can the text be bold and can we include a margin-left so the text isn't right up against the dropdown.

2. On smaller mobile screens #toolbar disappears entirely eliminating the ability to sort from a phone or small screen size. (This is at 600px and below).
Comment 3 David Nind 2020-01-26 20:26:02 UTC
Error message when applying patch - I think this means the patch didn't apply:

Applying: Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
error: sha1 information is lacking or useless (koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt).
error: could not build fake ancestor
Patch failed at 0001 Bug 23915: Replace OPAC list sort menu with Bootstrap menu button
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-23915-Replace-OPAC-list-sort-menu-with-Bootstr-dRZj3P.patch
Comment 4 Owen Leonard 2020-01-27 12:50:58 UTC Comment hidden (obsolete)
Comment 5 David Nind 2020-01-27 19:30:13 UTC
Everything looks and works fine except for the sort by copyright date.

- Copyright date (newest to oldest): sorts as asc when it should be desc (for example, lists an 1875 item before 2009)

- Copyright date (oldest to newest): sorts as desc when it should be asc (for example, lists an 2009 item before 1875)

It looks like this was introduced by Bug 23913 - the above behaviour is in master, but not in 19.11.x.

Should this be fixed in this bug, or should it be a new bug?
Comment 6 Owen Leonard 2020-01-28 15:38:44 UTC
Created attachment 98039 [details] [review]
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button

This patch adds JavaScript to the list contents page which converts the
resort form's <select> menu into a Bootstrap dropdown menu. This allows
for a more compact and consistent display.

To test, apply the patch and regenerate the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

View a list in the OPAC. The toolbar of list controls ("New list,"
"Download list," etc.) should have a similary-styled "Sort" button. Each
sorting option should work correctly.
Comment 7 Owen Leonard 2020-01-28 15:43:15 UTC
(In reply to David Nind from comment #5)
> Should this be fixed in this bug, or should it be a new bug?

I have modified the patch.
Comment 8 David Nind 2020-01-28 18:30:33 UTC
Created attachment 98045 [details] [review]
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button

This patch adds JavaScript to the list contents page which converts the
resort form's <select> menu into a Bootstrap dropdown menu. This allows
for a more compact and consistent display.

To test, apply the patch and regenerate the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

View a list in the OPAC. The toolbar of list controls ("New list,"
"Download list," etc.) should have a similary-styled "Sort" button. Each
sorting option should work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Katrin Fischer 2020-01-29 21:47:30 UTC
Created attachment 98092 [details] [review]
Bug 23915: Replace OPAC list sort menu with Bootstrap menu button

This patch adds JavaScript to the list contents page which converts the
resort form's <select> menu into a Bootstrap dropdown menu. This allows
for a more compact and consistent display.

To test, apply the patch and regenerate the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

View a list in the OPAC. The toolbar of list controls ("New list,"
"Download list," etc.) should have a similary-styled "Sort" button. Each
sorting option should work correctly.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize 2020-01-30 11:04:03 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-02-10 23:19:46 UTC
Enhancement not backported to 19.11.x