Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt
Owen Leonard 7761051a83
Bug 25166: Add "aria-hidden = true" to Font Awesome icons in the OPAC
Font Awesome's accessibility guidelines
(https://fontawesome.com/v4.7.0/accessibility/) suggest that we include
'aria-hidden="true"' in the icon markup. This prevents screen
readers from trying to read the icon. This patch adds the attribute.

To test apply the patch and browse the OPAC looking for any problems
with icons: On search results, bibliographic details page, the cart,
lists, etc.

Check the source and verify that Font Awesome icons have the
"aria-hidden" attribute.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Attribute present, all looks good. The 'aria-label' attribute is
not translatable, but it's another problem.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-04-29 17:28:04 +01:00

100 lines
3.3 KiB
Text

[% USE KohaDates %]
[% IF enrollments %]
<h4>Clubs currently enrolled in</h4>
<table id="clubs-table-enrolled" class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Date enrolled</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH e IN enrollments %]
<tr>
<td>[% e.club.name | html %]</td>
<td>[% e.club.description | html %]</td>
<td>[% e.date_enrolled | $KohaDates %]</td>
<td>
[% IF e.club.club_template.is_enrollable_from_opac %]
<button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id | html %] )">
<i class="fa fa-remove" aria-hidden="true"></i> Cancel enrollment
</button>
[% ELSE %]
Contact your library to be disenrolled from this club.
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF clubs %]
<h4>Clubs you can enroll in</h4>
<table id="clubs-table-unenrolled" class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH c IN clubs %]
<tr>
<td>[% c.name | html %]</td>
<td>[% c.description | html %]</td>
<td>
[% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.first_valid_email_address ) %]
<button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id | html%])">
<i class="fa fa-plus" aria-hidden="true"></i> Enroll
</button>
[% ELSE %]
<span class="hint">You must have an email address to enroll</span>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
<script>
function loadEnrollmentForm( id ) {
$("body").css("cursor", "progress");
$('#opac-user-clubs').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% borrower.borrowernumber | html %]&id=' + id, function() {
$("body").css("cursor", "default");
});
return false;
}
function cancelEnrollment( id ) {
$("body").css("cursor", "progress");
$.ajax({
type: "POST",
url: '/cgi-bin/koha/svc/club/cancel_enrollment',
data: { id: id },
success: function( data ) {
if ( data.success ) {
$('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrower.borrowernumber | html %]', function() {
$("body").css("cursor", "default");
});
} else {
alert(_("Unable to cancel enrollment!"));
}
},
dataType: 'json'
});
return false;
}
</script>