@@ -, +, @@ - Log in to the OPAC as a user with a reading history and titles in that history which have ratings. - Under the "your reading history" tab, your ratings should show under rated titles with the date of the rating. - Test also with OpacStarRatings disabled. --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 2 +- .../bootstrap/en/modules/opac-readingrecord.tt | 38 +++++++++++++++++++--- opac/opac-readingrecord.pl | 9 ++++- 3 files changed, 42 insertions(+), 7 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -3270,7 +3270,7 @@ $star-selected: #EDB867; a { -webkit-font-smoothing: antialiased; - font: normal normal normal 20px/1 FontAwesome; + font: normal normal normal 16px/1 FontAwesome; margin-right: 2px; text-decoration: none; text-rendering: auto; --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -4,6 +4,11 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Your checkout history [% INCLUDE 'doc-head-close.inc' %] +[% IF ( OpacStarRatings == 'all' ) %] + [% BLOCK cssinclude %] + [% Asset.css("css/jquery.rating.css") | $raw %] + [% END %] +[% END %] [% BLOCK cssinclude %] [% END %] @@ -76,7 +81,9 @@ Type - + [% IF ( JacketImages ) %] + + [% END %] Title Item type Call no. @@ -95,6 +102,7 @@ [% END %] [% issuetype | html %] + [% IF ( JacketImages ) %] [% IF ( AdlibrisEnabled && issue.normalized_isbn ) %] [% IF issue.BiblioDefaultViewmarc %] @@ -108,7 +116,7 @@ [% END %] [% IF OPACAmazonCoverImages %] [% IF issue.normalized_isbn %] - + [% ELSE %] No cover image available [% END %] @@ -135,6 +143,7 @@ [% END %] + [% END %] [% IF issue.BiblioDefaultViewmarc %] [% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %] @@ -143,7 +152,27 @@ [% ELSE %] [% issue.title | html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield | html %][% END %][% END %] [% END %] - [% issue.author | html %] +

[% issue.author | html %]

+ + [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' && issue.my_rating ) %] +
+
+
+ [% FOREACH i IN [ 1 2 3 4 5 ] %] + [% IF issue.my_rating.rating_value == i %] + + [% ELSIF issue.my_rating.rating_value > i %] + + [% ELSE %] + + [% END %] + [% END %] +
+
+ Rated on [% issue.my_rating.timestamp | $KohaDates %] +
+ [% END # / IF OpacStarRatings %] + [% UNLESS ( noItemTypeImages ) %] @@ -187,8 +216,8 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] [% INCLUDE 'datatables.inc' %] +[% IF ( OpacStarRatings == 'all' ) %][% Asset.js("lib/jquery/plugins/jquery.rating.js") | $raw %][% END %] [% END %] --- a/opac/opac-readingrecord.pl +++ a/opac/opac-readingrecord.pl @@ -33,6 +33,7 @@ use C4::Charset qw(StripNonXmlChars); use Koha::Patrons; use Koha::ItemTypes; +use Koha::Ratings; my $query = new CGI; @@ -121,6 +122,12 @@ foreach my $issue ( @{$issues} ) { : $my_summary_html =~ s/{BIBLIONUMBER}//g; $issue->{MySummaryHTML} = $my_summary_html; } + # Star ratings + if ( C4::Context->preference('OpacStarRatings') eq 'all' ) { + my $ratings = Koha::Ratings->search({ biblionumber => $issue->{biblionumber} }); + $issue->{ratings} = $ratings; + $issue->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef; + } } if (C4::Context->preference('BakerTaylorEnabled')) { @@ -140,7 +147,7 @@ BEGIN { } } -for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above +for(qw(OPACAmazonCoverImages GoogleJackets SyndeticsCoverImages)) { # BakerTaylorEnabled handled above C4::Context->preference($_) or next; $template->param($_=>1); $template->param(JacketImages=>1); --