[Bug 29280] New: Add OPACStarRatings to opac-shelves.tt
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Bug ID: 29280 Summary: Add OPACStarRatings to opac-shelves.tt Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org OPACStarRatings already exist on the OPAC details, results, and patron pages. Some librarians would find it handy if they were also included on OPAC lists (opac-shelves.tt) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 126558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126558&action=edit Bug 29280: Add OpacStarRatings to opac-shelves.tt To test: -Apply patch and restart everything -Set the system preference 'OpacStarRatings' to 'results, detail, lists, and patron' -Build a public lists with some items that have ratings -View the list page and you should see the ratings appear -Make sure that the ratings and the number of votes are acurate -Ratings on the opac-shelves should look and function just like those on the OPAC results page -Turn the 'OpacStarRatings' system pref to 'only detials' and 'no', making sure they do not show in the lists display -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Although it was introduced for (and named for) user-related pages, the include file user-star-ratings.inc could be used here, I think. Unless the ratings are supposed to display, but not be interacted with? If they are supposed to be interacted with, the template will need to include the relevant JS: [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %] [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %] [% Asset.js("js/ratings.js") | $raw %] [% END %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Owen Leonard from comment #2)
Although it was introduced for (and named for) user-related pages, the include file user-star-ratings.inc could be used here, I think. Unless the ratings are supposed to display, but not be interacted with?
If they are supposed to be interacted with, the template will need to include the relevant JS:
[% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %] [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %] [% Asset.js("js/ratings.js") | $raw %] [% END %]
Thanks for looking at this Owen! I followed the behavior of results.tt, which doesn't seem to allow users to interact with OpacStarRatings, only view them. Do you think we should allow patrons to interact with ratings on both results and lists? (if they are logged in) And if so, should I handle all of that in this bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Lucas Gass from comment #3)
Thanks for looking at this Owen! I followed the behavior of results.tt, which doesn't seem to allow users to interact with OpacStarRatings, only view them.
My mistake, I was misremembering. I don't recall if there was any particular reason for it to be like this, but that discussion can happen on a different bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- The search results page adds this event handler to keep the page from jumping if someone clicks one of the stars: $(".br-readonly a").on("click", function(e){ e.preventDefault(); }); Could you add that to opac-shelves.tt in a follow-up? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 126861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126861&action=edit Bug 29280: (follow-up) add event handler when clicking on star ratings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #126558|0 |1 is obsolete| | Attachment #126861|0 |1 is obsolete| | --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 126899 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126899&action=edit Bug 29280: Add OpacStarRatings to opac-shelves.tt To test: -Apply patch and restart everything -Set the system preference 'OpacStarRatings' to 'results, detail, lists, and patron' -Build a public lists with some items that have ratings -View the list page and you should see the ratings appear -Make sure that the ratings and the number of votes are acurate -Ratings on the opac-shelves should look and function just like those on the OPAC results page -Turn the 'OpacStarRatings' system pref to 'only detials' and 'no', making sure they do not show in the lists display Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 126900 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126900&action=edit Bug 29280: (follow-up) add event handler when clicking on star ratings Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 michelia.mason@swri.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michelia.mason@swri.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Sorry, not trying to throw this out, but: +$template->param( + OpacStarRatings => C4::Context->preference("OpacStarRatings") +); + Should we not remove this in favor of using TT in the template? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add OPACStarRatings to |Add star ratings to OPAC |opac-shelves.tt |lists display -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #9)
Sorry, not trying to throw this out, but:
+$template->param( + OpacStarRatings => C4::Context->preference("OpacStarRatings") +); +
Should we not remove this in favor of using TT in the template?
Indeed, we should! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 127190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127190&action=edit Bug 29280: (follow-up) Move OpacStarRating logic to template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #126899|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 127200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127200&action=edit Bug 29280: Add OpacStarRatings to opac-shelves.tt To test: -Apply patch and restart everything -Set the system preference 'OpacStarRatings' to 'results, detail, lists, and patron' -Build a public lists with some items that have ratings -View the list page and you should see the ratings appear -Make sure that the ratings and the number of votes are acurate -Ratings on the opac-shelves should look and function just like those on the OPAC results page -Turn the 'OpacStarRatings' system pref to 'only detials' and 'no', making sure they do not show in the lists display Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #126900|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 127201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127201&action=edit Bug 29280: (follow-up) add event handler when clicking on star ratings Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127190|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 127202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127202&action=edit Bug 29280: (follow-up) Move OpacStarRating logic to template Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |jonathan.druart+koha@gmail. | |com --- Comment #15 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Code is copy/pasted from somewhere else. I cannot push it like that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #15)
Code is copy/pasted from somewhere else. I cannot push it like that.
I took most of this code from the OPACStarRatings on the results page. What needs to be amended? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Lucas Gass from comment #16)
(In reply to Jonathan Druart from comment #15)
Code is copy/pasted from somewhere else. I cannot push it like that.
Are you asking me to put the repeated code in an include? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Lucas Gass from comment #17)
(In reply to Lucas Gass from comment #16)
(In reply to Jonathan Druart from comment #15)
Code is copy/pasted from somewhere else. I cannot push it like that.
Are you asking me to put the repeated code in an include?
Yes, please? It can be done on a separate bug report if you prefer. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #19 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #18)
(In reply to Lucas Gass from comment #17)
(In reply to Lucas Gass from comment #16)
(In reply to Jonathan Druart from comment #15)
Code is copy/pasted from somewhere else. I cannot push it like that.
Are you asking me to put the repeated code in an include?
Yes, please? It can be done on a separate bug report if you prefer.
No need for a separate bug, I will do it on this one! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #20 from Lucas Gass <lucas@bywatersolutions.com> --- I filed Bug 29749 to clean up OpacStarRatings a bit. If it is pushed it will make adding OpacStarRatings to lists easier. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- How can we move forward here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 --- Comment #22 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Quick note: bug 33953 introduces Koha::Biblio->ratings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29280 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lucas@bywatersolutions.com |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org