Bug 24156: move ColumnsSettings to TablesSettings
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / course_reserves / course-reserves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE TablesSettings %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Course reserves</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9
10 </head>
11
12 <body id="courses_course_reserves" class="course">
13
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a></div>
18
19     <div class="main container-fluid">
20         <div class="row">
21             <div class="col-md-10 col-md-offset-1">
22
23                     [% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %]
24                     <div id="toolbar">
25                         [% IF ( CAN_user_coursereserves_manage_courses ) %]
26                             <a class="btn btn-default" id="new_course" href="/cgi-bin/koha/course_reserves/course.pl"><i class="fa fa-plus"></i> New course</a>
27                         [% END %]
28                     </div><!-- /toolbar -->
29                     [% END %]
30
31                     <h1>Courses</h1>
32                     <table id="course_reserves_table">
33                         <thead>
34                             <tr>
35                                 <th>Name</th>
36                                 <th>Dept.</th>
37                                 <th>Course #</th>
38                                 <th>Section</th>
39                                 <th>Term</th>
40                                 <th>Instructors</th>
41                                 <th>Staff note</th>
42                                 <th>Public note</th>
43                                 <th># of students</th>
44                                 <th>Enabled</th>
45                             </tr>
46                         </thead>
47
48                         <tbody>
49                             [% FOREACH c IN courses %]
50                                 <tr>
51                                     <td><a href="course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %]</a></td>
52                                     <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %]</td>
53                                     <td>[% c.course_number | html %]</td>
54                                     <td>[% c.section | html %]</td>
55                                     <td>[% AuthorisedValues.GetByCode( 'TERM' c.term ) | html %]</td>
56                                     <td>
57                                         [% FOREACH i IN c.instructors %]
58                                             <div class="instructor"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% i.borrowernumber | uri %]">[% i.firstname | html %] [% i.surname | html %]</a></div>
59                                         [% END %]
60                                     </td>
61                                     <td>[% c.staff_note | html %]</td>
62                                     <td>[% c.public_note | $raw %]</td>
63                                     <td>[% c.students_count | html %]</td>
64                                     <td>
65                                         [% IF c.enabled == 'yes' %]
66                                             Yes
67                                         [% ELSE %]
68                                             No
69                                         [% END %]
70                                     </td>
71                             [% END %]
72                         </tbody>
73                     </table>
74
75             </div>
76         </div>
77
78 [% MACRO jsinclude BLOCK %]
79     [% INCLUDE 'datatables.inc' %]
80     [% INCLUDE 'columns_settings.inc' %]
81     <script>
82         var columns_settings = [% TablesSettings.GetColumns( 'coursereserves', 'courses', 'course_reserves_table', 'json' ) | $raw %];
83         $(document).ready(function() {
84             var ctable = KohaTable("course_reserves_table", {
85                 "sPaginationType": "full",
86                 "bAutoWidth": false
87             }, columns_settings );
88         });
89     </script>
90 [% END %]
91
92 [% INCLUDE 'intranet-bottom.inc' %]