4 <h4>Clubs currently enrolled in</h4>
6 <table id="table_clubenrollments">
11 <th>Date enrolled</th>
12 [% IF CAN_user_clubs_enroll %]<th class="NoSort">Actions</th>[% END %]
17 [% FOREACH e IN enrollments %]
19 <td>[% e.club.name | html %]</td>
20 <td>[% e.club.description | html %]</td>
21 <td>[% e.date_enrolled | $KohaDates %]</td>
22 [% IF CAN_user_clubs_enroll %]
24 <button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id | html %] )">
25 <i class="fa fa-remove"></i> Cancel enrollment
37 <h4>Clubs not enrolled in</h4>
39 <table id="table_clubnoenrollmemnts">
44 [% IF CAN_user_clubs_enroll %]<th class="NoSort">Actions</th>[% END %]
49 [% FOREACH c IN clubs %]
51 <td>[% c.name | html %]</td>
52 <td>[% c.description | html %]</td>
53 [% IF CAN_user_clubs_enroll %]
55 <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id | html %])">
56 <i class="fa fa-plus"></i> Enroll
67 $("#table_clubnoenrollmemnts, #table_clubenrollments").dataTable($.extend(true, {}, dataTablesDefaults, {
69 { 'sortable': false, 'targets': [ 'NoSort' ] }
74 [% IF CAN_user_clubs_enroll %]
75 function loadEnrollmentForm( id ) {
76 $("body").css("cursor", "progress");
77 $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber | html %]&id=' + id, function() {
78 $("body").css("cursor", "default");
84 function cancelEnrollment( id ) {
85 $("body").css("cursor", "progress");
88 url: '/cgi-bin/koha/svc/club/cancel_enrollment',
90 success: function( data ) {
92 $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]', function() {
93 $("body").css("cursor", "default");
96 alert(_("Unable to cancel enrollment!"));