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>
24 [% 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 enrollment
29 Contact your library to be disenrolled from this club.
40 <h4>Clubs you can enroll in</h4>
42 <table id="clubs-table-unenrolled" class="table table-bordered table-striped">
52 [% FOREACH c IN clubs %]
55 <td>[% c.description %]</td>
57 [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.first_valid_email_address ) %]
58 <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id %])">
59 <i class="icon-plus"></i> Enroll
62 <span class="hint">You must have an email address to enroll</span>
71 <script type="text/javascript">
72 function loadEnrollmentForm( id ) {
73 $("body").css("cursor", "progress");
74 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% borrower.borrowernumber %]&id=' + id, function() {
75 $("body").css("cursor", "default");
81 function cancelEnrollment( id ) {
82 $("body").css("cursor", "progress");
85 url: '/cgi-bin/koha/svc/club/cancel_enrollment',
87 success: function( data ) {
89 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrower.borrowernumber %]', function() {
90 $("body").css("cursor", "default");
93 alert(_("Unable to cancel enrollment!"));