From 5895d7c9c1ac0b39b5ffe0a5a6ce9c5f184ad348 Mon Sep 17 00:00:00 2001 From: nina martinez Date: Wed, 16 Apr 2025 11:46:27 +0200 Subject: [PATCH] Bug 39706: Add alternative text to the stars rating I just added an exception in the script. Sorry for the inconvenience. Test Plan: 1- Enable the following system preference: OpacStarRatings (results, details, and patron). 2- Apply the patch. 3- Go to the Opac. 4- Search a record. 5- Inspect the HTML code before the stars and notice that there is "Star rating" in a span tag with the class "sr-only". Inspect the stars, there should be a span tag for each star. After the stars, notice that there is the average rating in a span with the "sr-only" class. 6- Click on a record and do the same as the 5: go to the star rating, inspect the HTML code, and notice that there is a span tag for each star. 7- Now, log into an account. 8- Search a record. 9- It should be the same information as in the step 5. 10- Click on a record to view the details. Now, you can change the rating. Inspect the stars, each should have the number of stars in the span tag with a "sr-only" class, which are in the link tags. 11- For this part, you need to have a record checked out (if you don't have a record checked out, go to the staff interface and do it. Choose your patron and enter the barcode of the record). 12- Go to your account. In the "Checked Out" section, you should see the same as in the 10 step: the number of stars and be able to change your rating or make a new one. --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 6 +++--- .../bootstrap/en/includes/user-star-ratings.inc | 1 + .../bootstrap/en/modules/opac-results.tt | 9 +++++---- koha-tmpl/opac-tmpl/bootstrap/js/ratings.js | 15 +++++++++++++++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 05063f8160..b10559a327 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2629,7 +2629,7 @@ $star-selected: #EDB867; height: 28px; white-space: nowrap; - a { + span,a { font: normal normal normal 20px/1 "Font Awesome 6 Free"; -webkit-font-smoothing: antialiased; margin-right: 2px; @@ -2660,7 +2660,7 @@ $star-selected: #EDB867; } .br-readonly { - a { + span, a { cursor: default; } } @@ -2675,7 +2675,7 @@ $star-selected: #EDB867; @media print { .br-theme-fontawesome-stars { .br-widget { - a { + span,a { &::after { color: #000000; content: "\f006"; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/user-star-ratings.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/user-star-ratings.inc index b5aaac3e4a..7d3698f7ef 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/user-star-ratings.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/user-star-ratings.inc @@ -16,6 +16,7 @@ +