Bug 30327: Add options for sorting components
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-course-reserves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues %]
5 [% USE TablesSettings %]
6 [% PROCESS 'i18n.inc' %]
7
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Courses &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %]
12     [% Asset.css("css/datatables.css") | $raw %]
13 [% END %]
14
15 </head>
16 [% INCLUDE 'bodytag.inc' bodyid='opac-course-reserves' %]
17 [% INCLUDE 'masthead.inc' %]
18
19 <div class="main">
20     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
21         <ol class="breadcrumb">
22             <li class="breadcrumb-item">
23                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
24             </li>
25             <li class="breadcrumb-item active">
26                 <a href="#" aria-current="page">Course reserves</a>
27             </li>
28         </ol>
29     </nav> <!-- /#breadcrumbs -->
30
31     <div class="container-fluid">
32         <div class="row">
33             <div class="col order-first order-md-first order-lg-2">
34                 <div id="courses" class="maincontent">
35                     <h1>Courses</h1>
36
37                     <table id="course_reserves_table" class="table table-bordered table-striped table-condensed">
38                         <caption class="sr-only">Courses</caption>
39                         <thead>
40                             <tr>
41                                 <th>Name</th>
42                                 <th>Dept.</th>
43                                 <th>Course #</th>
44                                 <th>Section</th>
45                                 <th>[% tp('Semester', 'Term') | html %]</th>
46                                 <th>Instructors</th>
47                                 <th>Notes</th>
48                             </tr>
49                         </thead>
50
51                         <tbody>
52                             [% FOREACH c IN courses %]
53                                 <tr>
54                                     <td><a href="opac-course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %]</a></td>
55                                     <td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department, 1 ) | html %]</td>
56                                     <td>[% c.course_number | html %]</td>
57                                     <td>[% c.section | html %]</td>
58                                     <td>[% AuthorisedValues.GetByCode( 'TERM' c.term, 1 ) | html %]</td>
59                                     <td>
60                                       [% FOREACH i IN c.instructors %]
61                                           <div class="instructor"><span class="inst_surname">[% i.surname | html %]</span>[% IF i.firstname %]<span class="instr_separator">, </span><span class="instr_firstname">[% i.firstname | html %]</span>[% END %]</div>
62                                       [% END %]
63                                     </td>
64                                     <td>[% c.public_note | $raw %]</td>
65                             [% END %]
66                         </tbody>
67                     </table>
68                 </div> <!-- / #courses -->
69             </div> <!-- / .col -->
70         </div> <!-- / .row -->
71     </div> <!-- / .container-fluid -->
72 </div> <!-- / .main -->
73 [% INCLUDE 'opac-bottom.inc' %]
74 [% BLOCK jsinclude %]
75     [% INCLUDE 'datatables.inc' %]
76     [% INCLUDE 'columns_settings.inc' %]
77     <script>
78         $(document).ready(function() {
79             columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'course_reserves_table', 'json' ) | $raw %]
80             KohaTable("#course_reserves_table", {
81                 "dom": '<"top"f>rt<"clear">',
82                 "sorting": [[ 1, "asc" ]],
83                 "autoWidth": false,
84                 "asColumnDefs": [
85                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
86                 ],
87                 "language": {
88                     "search": "_INPUT_",
89                     "searchPlaceholder": _("Search courses")
90                 }
91             }, columns_settings );
92         });
93     </script>
94 [% END %]