Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version
Summary: Replace OPAC detail's results browser with non-JavaScript version
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-07 18:22 UTC by Owen Leonard
Modified: 2018-09-10 17:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Screenshot of the proposed change (142.71 KB, image/png)
2018-06-07 18:22 UTC, Owen Leonard
Details
Wanted: help adding pagination to the pagination (17.28 KB, image/png)
2018-06-07 19:25 UTC, Owen Leonard
Details
Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version (110.29 KB, patch)
2018-06-08 12:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version (22.77 KB, patch)
2018-06-08 12:16 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version (23.04 KB, patch)
2018-06-27 13:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version (23.09 KB, patch)
2018-08-09 13:02 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 20898: Replace OPAC detail's results browser with non-JavaScript version (22.81 KB, patch)
2018-08-10 13:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20898: Replace OPAC detail's results browser with non-JavaScript version (22.87 KB, patch)
2018-08-10 14:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20898: Replace OPAC detail's results browser with non-JavaScript version (22.89 KB, patch)
2018-08-24 12:44 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20898: Replace OPAC detail's results browser with non-JavaScript version (23.00 KB, patch)
2018-08-31 14:12 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 2018-06-07 18:22:03 UTC
Created attachment 75888 [details]
Screenshot of the proposed change

The HTML generated by the OPAC detail page's results browser (enabled by the  OpacBrowseResults system preference) could be easily done in the HTML. This would make it easier to understand and debug, and provide the possibility of having it work without JavaScript.
Comment 1 Owen Leonard 2018-06-07 19:25:42 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2018-06-08 12:10:02 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2018-06-08 12:16:51 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2018-06-27 13:00:23 UTC Comment hidden (obsolete)
Comment 5 sandboxes@biblibre.com 2018-08-09 13:02:14 UTC
Patch tested with a sandbox, by Cab Vinton <bibliwho@gmail.com>
Comment 6 sandboxes@biblibre.com 2018-08-09 13:02:46 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2018-08-10 12:21:55 UTC
Hi Owen, can you please provide a rebased patch?

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version
Using index info to reconstruct a base tree...
A	koha-tmpl/opac-tmpl/bootstrap/less/opac.less
A	koha-tmpl/opac-tmpl/bootstrap/less/responsive.less
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): koha-tmpl/opac-tmpl/bootstrap/less/opac.less deleted in HEAD and modified in Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version. Version Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version of koha-tmpl/opac-tmpl/bootstrap/less/opac.less left in tree.
Auto-merging koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
error: Failed to merge in the changes.
Patch failed at 0001 Bug 20898 - Replace OPAC detail's results browser with non-JavaScript version
Use 'git am --show-current-patch' to see the failed 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-20898---Replace-OPAC-details-results-browser-w-3X0gZy.patch
Comment 8 Owen Leonard 2018-08-10 13:13:54 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2018-08-10 14:24:02 UTC Comment hidden (obsolete)
Comment 10 Nick Clemens 2018-08-24 12:44:40 UTC Comment hidden (obsolete)
Comment 11 Nick Clemens 2018-08-24 12:45:58 UTC
I rebased (I think correctly) but I notice that when I hit 'Close' in the browse results it actually opens the list? Seems a little confusing.

Is the JS section with "prepareShelfBrowser" still needed? Or was that bad rebase on my part?
Comment 12 Owen Leonard 2018-08-31 14:12:15 UTC
Created attachment 78328 [details] [review]
Bug 20898: Replace OPAC detail's results browser with non-JavaScript version

This patch moves generation of the OPAC detail page's results browser
from JavaScript to the template. This makes the template easier to
understand and easier to debug. It also makes it possible for the widget
to be completely non-dependent on JavaScript.

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)

 - Enable the OpacBrowseResults system preference and perform a search
   in the OPAC which will return multiple results.
 - Click on any title in the first page of search results.
 - On the bibliographic detail page there should be a "Browse results"
   link in the right-hand sidebar just as before.
   - Test that the "Previous," "Back to results," and "Next" links work
     correctly.
   - Click the "Browse results" link. A list of the first 20 search
     results should appear. An arrow should indicate the title you're
     viewing.
   - Click any title in the results browser. The page should correctly
     load that record.
   - Clicking the numbered links at the top of the results browser
     should do the same.

Signed-off-by: Cab Vinton <bibliwho@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Owen Leonard 2018-08-31 14:13:07 UTC
(In reply to Nick Clemens from comment #11)
> I rebased (I think correctly) but I notice that when I hit 'Close' in the
> browse results it actually opens the list? Seems a little confusing.

I tried my own rebase and it looked good to me when I tested. Can you please try again?
Comment 14 Nick Clemens 2018-09-06 17:39:44 UTC
Awesome work all! 

Pushed to master for 18.11
Comment 15 Martin Renvoize 2018-09-10 17:25:21 UTC
I really like this change :)

Enhancement, will not be backported to 18.05.x series.