4 <table id="clubs-table-enrolled" class="table table-bordered table-striped">
8 Clubs you are currently enrolled in
14 <th>Date enrolled</th>
20 [% FOREACH e IN enrollments %]
22 <td>[% e.club.name %]</td>
23 <td>[% e.club.description %]</td>
24 <td>[% e.date_enrolled | $KohaDates %]</td>
25 [% IF e.club.club_template.is_enrollable_from_opac %]
27 <a class="btn btn-xs" onclick="cancelEnrollment( [% e.id %] )">
28 <i class="icon-remove"></i> Cancel
39 <table id="clubs-table-unenrolled" class="table table-bordered table-striped">
43 Clubs you can enroll in
54 [% FOREACH c IN clubs %]
57 <td>[% c.description %]</td>
59 [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.FirstValidEmailAddress ) %]
60 <a class="btn btn-xs" onclick="loadEnrollmentForm([% c.id %])">
61 <i class="icon-plus"></i> Enroll
64 <span class="hint">You must have an email address to enroll</span>
73 <script type="text/javascript">
74 function loadEnrollmentForm( id ) {
75 $("body").css("cursor", "progress");
76 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% borrower.borrowernumber %]&id=' + id, function() {
77 $("body").css("cursor", "default");
83 function cancelEnrollment( id ) {
84 $("body").css("cursor", "progress");
87 url: '/cgi-bin/koha/svc/club/cancel_enrollment',
89 success: function( data ) {
91 $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrower.borrowernumber %]', function() {
92 $("body").css("cursor", "default");
95 alert(_("Unable to cancel enrollment!"));