Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC
[srvgit] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-course-reserves.tt
1 [% USE Koha %]
2 [% USE AuthorisedValues %]
3
4 [% INCLUDE 'doc-head-open.inc' %]
5 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Courses
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %]
8     <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% END %]
10
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
13 [% INCLUDE 'masthead.inc' %]
14
15 <div class="main">
16     <ul class="breadcrumb">
17         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18         <li><a href="#">Course reserves</a></li>
19     </ul>
20
21     <div class="container-fluid">
22         <div class="row-fluid">
23             <div class="span12">
24
25                     <h1>Courses</h1>
26
27                     <table id="course_reserves_table" class="table table-bordered table-striped table-condensed">
28                         <thead>
29                             <tr>
30                                 <th>Name</th>
31                                 <th>Dept.</th>
32                                 <th>Course #</th>
33                                 <th>Section</th>
34                                 <th>Term</th>
35                                 <th>Instructors</th>
36                                 <th>Notes</th>
37                             </tr>
38                         </thead>
39
40                         <tbody>
41                             [% FOREACH c IN courses %]
42                                 <tr>
43                                     <td><a href="opac-course-details.pl?course_id=[% c.course_id %]">[% c.course_name %]</a></td>
44                                     <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department, 1 ) %]</td>
45                                     <td>[% c.course_number %]</td>
46                                     <td>[% c.section %]</td>
47                                     <td>[% AuthorisedValues.GetByCode( 'TERM' c.term ) %]</td>
48                                     <td>
49                                       [% FOREACH i IN c.instructors %]
50                                           <div class="instructor">[% i.firstname %] [% i.surname %]</div>
51                                       [% END %]
52                                     </td>
53                                     <td>[% c.public_note %]</td>
54                             [% END %]
55                         </tbody>
56                     </table>
57             </div> <!-- / .span12 -->
58         </div> <!-- / .row-fluid -->
59     </div> <!-- / .container-fluid -->
60 </div> <!-- / .main -->
61 [% INCLUDE 'opac-bottom.inc' %]
62 [% BLOCK jsinclude %]
63     [% INCLUDE 'datatables.inc' %]
64     <script type="text/javascript">
65     $(document).ready(function() {
66         $("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
67             "sDom": '<"top"flp>rt<"clear">',
68         }));
69     });
70     </script>
71 [% END %]