Bugzilla – Attachment 87011 Details for
Bug 22432
Star ratings plugin replacement missing from a couple pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22432: Star ratings plugin replacement missing from a couple pages
Bug-22432-Star-ratings-plugin-replacement-missing-.patch (text/plain), 5.22 KB, created by
Owen Leonard
on 2019-03-26 12:18:13 UTC
(
hide
)
Description:
Bug 22432: Star ratings plugin replacement missing from a couple pages
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-03-26 12:18:13 UTC
Size:
5.22 KB
patch
obsolete
>From 7ab99e83d9730fbb5eeac5b2a7d7d35a6db83da9 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 28 Feb 2019 13:12:59 +0000 >Subject: [PATCH] Bug 22432: Star ratings plugin replacement missing from a > couple pages > >This patch modifies two templates to conform to the change to the start >ratings plugin: Overdrive search results and RecordedBooks search >results. > >On the Overdrive page, the star ratings are now correctly displayed >using the new plugin. On the RecordedBooks page, star ratings code has >been removed because it is unused. RecordedBooks doesn't provide ratings >information in their API. > >To test you need credentials for both Overdrive and RecordedBooks. Apply >the patch and enable both services. > > - In the OPAC, perform a search that will return results from Overdrive > and RecordedBooks. > - Open the search results for each of those services. > - On the Overdrive search results page, star ratings should appear > correctly (in read-only mode). > - On the RecordedBooks page everything should look the same. >--- > .../bootstrap/en/modules/opac-overdrive-search.tt | 22 ++++++++++++++-------- > .../en/modules/opac-recordedbooks-search.tt | 10 +--------- > 2 files changed, 15 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt >index 1c2548b..62101ac 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt >@@ -5,12 +5,6 @@ > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › OverDrive search for '[% q | html %]'</title> > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %] >-[% Asset.css("css/jquery.rating.css") | $raw %] >-<style> >-.actions a.addtocart { >- display: inline; >-} >-</style> > [% END %] > </head> > [% INCLUDE 'bodytag.inc' bodyid='overdrive-results-page' bodyclass='scrollto' %] >@@ -62,7 +56,6 @@ > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] > [% Asset.js("js/overdrive.js") | $raw %] >-[% Asset.js("lib/jquery/plugins/jquery.rating.js") | $raw %] > <script> > var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %]; > var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( '\r', '\\r' ) | html %]"; >@@ -124,11 +117,24 @@ function search( offset ) { > results.push( '<span class="results_summary mediatype"><span class="label">' + _("Type:") + ' </span>', prod.mediaType, '</span>' ); > > if ( prod.starRating ) { >+ var rating_value = Math.round( prod.starRating ); > results.push( '<div class="results_summary ratings">' ); >+ results.push( '<div class="br-wrapper br-theme-fontawesome-stars">'); >+ results.push( '<div class="br-widget br-readonly">'); > for ( var rating = 1; rating <= 5; rating++ ) { >- results.push( '<input class="star" type="radio" name="rating-' + i + '" value="' + rating + '"' + ( rating == Math.round( prod.starRating ) ? ' checked="checked"' : '' ) + ' disabled="disabled" />' ); >+ >+ results.push( '<a href="#"' ); >+ if( rating == rating_value ){ >+ results.push( ' class="br-selected br-current"></a>' ); >+ } else if( rating_value > rating ){ >+ results.push( ' class="br-selected"></a>' ); >+ } else { >+ results.push( '></a>'); >+ } > } > results.push( '</div>' ); >+ results.push( '</div>' ); >+ results.push( '</div>' ); > } > > results.push( '</td>' ); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >index 52d8c2c..64366cd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt >@@ -5,12 +5,6 @@ > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › RecordedBooks search for '[% q | html %]'</title> > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %] >-[% Asset.css("css/jquery.rating.css") | $raw %] >-<style> >-.actions a.addtocart { >- display: inline; >-} >-</style> > [% END %] > </head> > [% INCLUDE 'bodytag.inc' bodyid='recordedbooks-results-page' bodyclass='scrollto' %] >@@ -62,8 +56,7 @@ > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] > [% Asset.js("js/recordedbooks.js") | $raw %] >-[% Asset.js("lib/jquery/plugins/jquery.rating.js") | $raw %] >-<script type="text/javascript"> >+<script> > var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( '\r', '\\r' ) |html %]"; > var results_per_page = [% OPACnumSearchResults || 20 | html %]; > >@@ -144,7 +137,6 @@ function search( page ) { > > if ( pages.length > 1 ) $( '#top-pages, #bottom-pages' ).find( '.pagination' ).html( '<ul>' + pages.join( '' ) + '</ul>'); > >- $( '#recordedbooks-results-list input.star' ).rating(); > } ); > } > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22432
:
87011
|
87062
|
87242