From a20c84f52ec230bc49d9b75b80821ef19f6d370a 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 This patch improves the accessibility of the star ratings. To test this patch, you need to use a screen reader. Some help for using the screen reader: to navigate between links, use the Tab key, to hear the text on the page, use the arrow keys. Test Plan: 1. Enable the following system preference: OpacStarRatings (results, details, and patron). 2. Apply the patch. 3. Launch your screen reader (ex: Orca). 4. Go to the Opac interface. 5. Make a search. 6. Navigate through the record results and go to the star rating, you should hear only the rating average of each record and the number of votes. 7. On a record, do the same: go to the star rating, you should hear the rating average of the record and the number of votes. 8. Now, log into an account. 9. Make a search. 10. Navigate with the screen reader to the stars; you should hear the same information as in step 6. 11. Click on a record to view the details and navigate to the rating. Now, you can change the rating. Tab through the stars, it should tell you the number of each star. When you use the tab or arrow keys, you should still hear the average and the number of votes. 12. For this part, you need to have a record checkout (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). 13. Go to your account. In the "Checked Out" section, navigate with the screen reader to the star rating, you should hear the number of stars and be able to change your rating or make a new one. You have to hear your rating, the average and the number of votes. --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 6 +++--- .../bootstrap/en/includes/user-star-ratings.inc | 1 + .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 9 +++++---- koha-tmpl/opac-tmpl/bootstrap/js/ratings.js | 13 +++++++++++++ 4 files changed, 22 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 5f182f644a..d0caa2b08d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2624,7 +2624,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; @@ -2655,7 +2655,7 @@ $star-selected: #EDB867; } .br-readonly { - a { + span, a { cursor: default; } } @@ -2670,7 +2670,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 @@ +