From abba3aace199d2fc3bb0122e03603bd6652a2f73 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 3 Jul 2013 14:34:31 -0400 Subject: [PATCH] Bug 10125 - Babeltheque star image must use sprite Content-Type: text/plain; charset="utf-8" When I removed images from the OPAC in favor of sprites I didn't take into account the display of star ratings from Babeltheque. This patch copies the star ratings display from Koha's own ratings display, though it is not dependent on JavaScript. I'm sure testing would be easy for someone with access to the Babeltheque service, but I do not. I temporarily modified the template to set some variables for testing purposes: [% SET SEARCH_RESULT.score_int = 3 %] [% SET SEARCH_RESULT.score_avg = 3 % [% SET SEARCH_RESULT.num_scores = 87 %] This enabled the display of the ratings, allowing me to confirm that stars display correctly. Ratings should work with and without OpacStarRatings enabled. --- .../opac-tmpl/prog/en/modules/opac-results.tt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index 923effa..9150624 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -571,8 +571,16 @@ $(document).ready(function(){ [% END %] [% IF ( SEARCH_RESULT.score_avg ) %] - - [% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates) +
+ [% FOREACH i IN [ 1 2 3 4 5 ] %] + [% IF ( SEARCH_RESULT.score_int >= i ) %] + + [% ELSE %] + + [% END %] + [% END %] +    [% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates) + [% IF ( SEARCH_RESULT.num_critics ) %] [% END %] @@ -585,7 +593,7 @@ $(document).ready(function(){ [% IF ( SEARCH_RESULT.num_quotations ) %] [% END %] - +
[% END %] [% IF ( LibraryThingForLibrariesID ) %]
[% END %] -- 1.7.9.5