diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt index 8e0f99659d..25c1e0363b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt @@ -8,10 +8,10 @@ Clubs - Name + Name Description Date enrolled -   +   @@ -24,7 +24,7 @@ [% e.date_enrolled | $KohaDates %] [% IF e.club.club_template.is_enrollable_from_opac %] - [% ELSE %] @@ -45,9 +45,9 @@ - + - + @@ -59,7 +59,7 @@
NameName Description  
[% c.description | html %] [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.notice_email_address ) %] - [% ELSE %] @@ -102,19 +102,35 @@ function cancelEnrollment( id ) { }); return false; } -var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); -Tables.each(function(){ - $(this).dataTable($.extend(true, {}, dataTablesDefaults, { - "searching": false, - "paging": false, - "info": false, - "autoWidth": false, - "responsive": { - "details": { "type": 'column',"target": -1 } - }, - "columnDefs": [ - { "className": 'dtr-control', "orderable": false, "targets": -1 } - ], - })); -}); + + var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); + Tables.each(function(){ + $(this).dataTable($.extend(true, {}, dataTablesDefaults, { + "searching": false, + "paging": false, + "info": false, + "autoWidth": false, + "responsive": { + "details": { "type": "column", "target": -1 } + }, + "columnDefs": [ + { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, + { "className": "dtr-control", "orderable": false, "targets": -1 }, + ], + })); + }); + + $(".cancel_enrollment").on("click", function(e){ + e.preventDefault(); + let clubid = $(this).data("id"); + cancelEnrollment( clubid ); + }); + + $(".load_enrollment").on("click", function(e){ + e.preventDefault(); + let clubid = $(this).data("id"); + loadEnrollmentForm( clubid ); + }); + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt index 88939b10e5..a8dde0bbdf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt @@ -29,8 +29,8 @@
- - Cancel + + Cancel
@@ -62,4 +62,16 @@ function showClubs() { $("body").css("cursor", "default"); }); } + + $(document).ready(function(){ + $(".add_enrollment").on("click", function(e){ + e.preventDefault(); + addEnrollment(); + }); + + $(".show_clubs").on("click", function(e){ + e.preventDefault(); + showClubs(); + }); + });