5 <h4>Clubs currently enrolled in</h4>
7 <table id="clubs-table-enrolled" class="table table-bordered table-striped">
12 <th>Date enrolled</th>
18 [% FOREACH e IN enrollments %]
20 <td>[% e.club.name %]</td>
21 <td>[% e.club.description %]</td>
22 <td>[% e.date_enrolled | $KohaDates %]</td>
23 [% IF e.club.club_template.is_enrollable_from_opac %]
25 <button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id %] )">
26 <i class="icon-remove"></i> Cancel
38 <h4>Clubs you can enroll in</h4>
40 <table id="clubs-table-unenrolled" class="table table-bordered table-striped">
50 [% FOREACH c IN clubs %]
53 <td>[% c.description %]</td>
55 [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.first_valid_email_address ) %]
56 <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id %])">
57 <i class="icon-plus"></i> Enroll
60 <span class="hint">You must have an email address to enroll</span>
69 <script type="text/javascript">
70 function loadEnrollmentForm( id ) {
71 $("body").css("cursor", "progress");
72 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% borrower.borrowernumber %]&id=' + id, function() {
73 $("body").css("cursor", "default");
79 function cancelEnrollment( id ) {
80 $("body").css("cursor", "progress");
83 url: '/cgi-bin/koha/svc/club/cancel_enrollment',
85 success: function( data ) {
87 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrower.borrowernumber %]', function() {
88 $("body").css("cursor", "default");
91 alert(_("Unable to cancel enrollment!"));