Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt
Wainui Witika-Park 9db6630c61 Bug 27610: Changed pages of OPAC to have a <h1>
Changed each of the pages in the OPAC to have one <h1> tag showing that describes the page, rather than the <h1> describing the logo.

The hierarchy of heading tags may be broken in many pages, but this will be dealt with in a follow up patch or bug.

To test:
1) Go to the OPAC
2) Apply patch
3) Go to each of the pages and check that they have an obvious and
descriptive heading
4) Ensure that the heading in the page is <h1>

Sponsored by: Catalyst IT
Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-01 18:51:38 +02:00

100 lines
3.3 KiB
Text

[% USE KohaDates %]
[% IF enrollments %]
<h2>Clubs currently enrolled in</h2>
<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 %]
<h2>Clubs you can enroll in</h2>
<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>