View | Details | Raw Unified | Return to bug 34945
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt (-21 / +37 lines)
Lines 8-17 Link Here
8
        <caption class="sr-only">Clubs</caption>
8
        <caption class="sr-only">Clubs</caption>
9
        <thead>
9
        <thead>
10
            <tr>
10
            <tr>
11
                <th>Name</th>
11
                <th class="all">Name</th>
12
                <th>Description</th>
12
                <th>Description</th>
13
                <th>Date enrolled</th>
13
                <th>Date enrolled</th>
14
                <th>&nbsp;</th>
14
                <th class="NoSort all">&nbsp;</th>
15
                <th></th>
15
                <th></th>
16
            </tr>
16
            </tr>
17
        </thead>
17
        </thead>
Lines 24-30 Link Here
24
                    <td>[% e.date_enrolled | $KohaDates %]</td>
24
                    <td>[% e.date_enrolled | $KohaDates %]</td>
25
                    <td>
25
                    <td>
26
                        [% IF e.club.club_template.is_enrollable_from_opac %]
26
                        [% IF e.club.club_template.is_enrollable_from_opac %]
27
                            <button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id | html %] )">
27
                            <button class="btn btn-sm btn-danger cancel_enrollment" data-id="[% e.id | html %]">
28
                                <i class="fa fa-times" aria-hidden="true"></i> Cancel enrollment
28
                                <i class="fa fa-times" aria-hidden="true"></i> Cancel enrollment
29
                            </button>
29
                            </button>
30
                        [% ELSE %]
30
                        [% ELSE %]
Lines 45-53 Link Here
45
    <table id="clubs-table-unenrolled" class="table table-bordered table-striped">
45
    <table id="clubs-table-unenrolled" class="table table-bordered table-striped">
46
        <thead>
46
        <thead>
47
            <tr>
47
            <tr>
48
                <th>Name</th>
48
                <th class="all">Name</th>
49
                <th>Description</th>
49
                <th>Description</th>
50
                <th>&nbsp;</th>
50
                <th class="NoSort all">&nbsp;</th>
51
                <th></th>
51
                <th></th>
52
            </tr>
52
            </tr>
53
        </thead>
53
        </thead>
Lines 59-65 Link Here
59
                    <td>[% c.description | html %]</td>
59
                    <td>[% c.description | html %]</td>
60
                    <td>
60
                    <td>
61
                        [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.notice_email_address ) %]
61
                        [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.notice_email_address ) %]
62
                            <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id | html%])">
62
                            <button class="btn btn-sm btn-primary load_enrollment" data-id="[% c.id | html%]">
63
                                <i class="fa fa-plus" aria-hidden="true"></i> Enroll
63
                                <i class="fa fa-plus" aria-hidden="true"></i> Enroll
64
                            </button>
64
                            </button>
65
                        [% ELSE %]
65
                        [% ELSE %]
Lines 102-120 function cancelEnrollment( id ) { Link Here
102
    });
102
    });
103
    return false;
103
    return false;
104
}
104
}
105
var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled");
105
106
Tables.each(function(){
106
    var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled");
107
    $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
107
    Tables.each(function(){
108
        "searching": false,
108
        $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
109
        "paging": false,
109
            "searching": false,
110
        "info": false,
110
            "paging": false,
111
        "autoWidth": false,
111
            "info": false,
112
        "responsive": {
112
            "autoWidth": false,
113
            "details": { "type": 'column',"target": -1 }
113
            "responsive": {
114
        },
114
                "details": { "type": "column", "target": -1 }
115
        "columnDefs": [
115
            },
116
            { "className": 'dtr-control', "orderable": false, "targets": -1 }
116
            "columnDefs": [
117
        ],
117
                { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] },
118
    }));
118
                { "className": "dtr-control", "orderable": false, "targets": -1 },
119
});
119
            ],
120
        }));
121
    });
122
123
    $(".cancel_enrollment").on("click", function(e){
124
        e.preventDefault();
125
        let clubid = $(this).data("id");
126
        cancelEnrollment( clubid );
127
    });
128
129
    $(".load_enrollment").on("click", function(e){
130
        e.preventDefault();
131
        let clubid = $(this).data("id");
132
        loadEnrollmentForm( clubid );
133
    });
134
135
120
</script>
136
</script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt (-3 / +14 lines)
Lines 29-36 Link Here
29
            </ol>
29
            </ol>
30
        </fieldset>
30
        </fieldset>
31
        <fieldset class="action">
31
        <fieldset class="action">
32
            <button class="btn btn-primary" onclick="addEnrollment(); return false;">Finish enrollment</button>
32
            <button class="btn btn-primary add_enrollment">Finish enrollment</button>
33
            <a href="#" class="cancel" onclick="showClubs(); return false;">Cancel</a>
33
            <a href="#" class="cancel show_clubs">Cancel</a>
34
        </fieldset>
34
        </fieldset>
35
    </form>
35
    </form>
36
</div>
36
</div>
Lines 62-65 function showClubs() { Link Here
62
        $("body").css("cursor", "default");
62
        $("body").css("cursor", "default");
63
    });
63
    });
64
}
64
}
65
66
    $(document).ready(function(){
67
        $(".add_enrollment").on("click", function(e){
68
            e.preventDefault();
69
            addEnrollment();
70
        });
71
72
        $(".show_clubs").on("click", function(e){
73
            e.preventDefault();
74
            showClubs();
75
        });
76
    });
65
</script>
77
</script>
66
- 

Return to bug 34945