Bug 32445: (follow-up) Fix availability display on opac-course-details
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-course-details.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE AuthorisedValues %]
6 [% USE ItemTypes %]
7 [% USE Branches %]
8 [% USE TablesSettings %]
9 [% PROCESS 'i18n.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Course reserves for [% course.course_name | html %] &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% BLOCK cssinclude %]
14     [% Asset.css("css/datatables.css") | $raw %]
15 [% END %]
16
17 </head>
18 [% INCLUDE 'bodytag.inc' bodyid='opac-course-details' %]
19 [% INCLUDE 'masthead.inc' %]
20
21 <div class="main">
22     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
23         <ol class="breadcrumb">
24             <li class="breadcrumb-item">
25                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
26             </li>
27             <li class="breadcrumb-item">
28                 <a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
29             </li>
30             <li class="breadcrumb-item active">
31                 <a href="#" aria-current="page">Course reserves for &nbsp;<em>[% course.course_name | html %]</em></a>
32             </li>
33         </ol>
34     </nav> <!-- /#breadcrumbs -->
35
36     <div class="container-fluid">
37         <div class="row">
38             <div class="col">
39                 <div id="course_reserves" class="maincontent">
40
41                     <h1>Course reserves for <em>[% course.course_name | html %]</em></h1>
42                     <div class="rows">
43                         <ol>
44                             [% IF ( course.term ) %]<li><span class="label">[% tp('Semester', 'Term:') | html %]</span> [% AuthorisedValues.GetByCode( 'TERM', course.term, 1 ) | html %]</li>[% END %]
45                             <li><span class="label">Department:</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department, 1 ) | html %]</li>
46                             [% IF ( course.course_number ) %]<li><span class="label">Course number:</span> [% course.course_number | html %]</li>[% END %]
47                             [% IF ( course.section ) %]<li><span class="label">Section:</span> [% course.section | html %]</li>[% END %]
48                             [% IF ( course.instructors ) %]
49                                 <li><span class="label">Instructors:</span>
50                                     <ul>
51                                         [% FOREACH i IN course.instructors %]
52                                             <li><div class="instructor">[% i.firstname | html %] [% i.surname | html %]</div></li>
53                                         [% END %]
54                                     </ul>
55                                 </li>
56                             [% END %]
57                             [% IF ( course.public_note ) %]<li><span class="label">Notes:</span> [% course.public_note | $raw %]</li>[% END %]
58                         </ol>
59                     </div>
60
61                     [% IF ( course_reserves ) %]
62                         <table id="course-items-table" class="table table-bordered table-striped table-condensed">
63                         <caption class="sr-only">Courses</caption>
64                             <thead>
65                                 <tr>
66                                     <th class="anti-the">Title</th>
67                                     <th>Author</th>
68                                     <th>Item type</th>
69                                     <th>Location</th>
70                                     <th>Collection</th>
71                                     <th>Call number</th>
72                                     <th>Copy number</th>
73                                     <th>Status</th>
74                                     <th>Date due</th>
75                                     <th>Notes</th>
76                                     <th>Link</th>
77                                 </tr>
78                             </thead>
79
80                             <tbody>
81                                 [% FOREACH cr IN course_reserves %]
82                                     <tr>
83                                         <td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title-head.inc' biblio=cr.biblio %]</a></td>
84                                         <td>[% cr.biblio.author | html %]</td>
85                                         <td>[% ItemTypes.GetDescription( cr.item.itype ) | html %]</td>
86                                         <td>[% Branches.GetName( cr.item.holdingbranch ) | html %] <br/> <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => cr.item.location, opac => 1 ) | html %]</em></td>
87                                         <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode, opac => 1 ) | html %]</td>
88                                         <td>[% cr.item.itemcallnumber | html %]</td>
89                                         <td>[% cr.item.copynumber | html %]</td>
90                                         <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue show_recall_link=Koha.Preference('UseRecalls') %]</td>
91                                         <td data-order="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates  as_due_date => 1 %]</td>
92                                         <td>[% IF ( cr.public_note ) %]
93                                                 [% cr.public_note | $raw %]
94                                             [% ELSIF ( cr.item.itemnotes ) %]
95                                                 [% cr.item.itemnotes | $raw %]
96                                             [% END %]
97                                         </td>
98                                         <td>[% IF (cr.item.uri) %]
99                                                 <a href="[% cr.item.uri | url %]">Item URI</a>
100                                             [% ELSIF (cr.biblioitem.url) %]
101                                                 <a href="[% cr.biblioitem.url | url %]">Record URL</a>
102                                             [% END %]
103                                         </td>
104                                     </tr>
105                                 [% END %]
106                             </tbody>
107                         </table>
108                     [% ELSE %]
109                         <br style="clear:both;" />
110                         <div class="alert alert-info">
111                             <p>No reserves have been selected for this course.</p>
112                         </div>
113                     [% END %]
114                 </div> <!-- / #course_reserves -->
115             </div> <!-- / .col -->
116         </div> <!-- / .row -->
117     </div> <!-- / .container-fluid -->
118 </div> <!-- / .main -->
119 [% INCLUDE 'opac-bottom.inc' %]
120 [% BLOCK jsinclude %]
121     [% INCLUDE 'datatables.inc' %]
122     [% INCLUDE 'columns_settings.inc' %]
123     <script>
124         $(document).ready(function() {
125             columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'course-items-table', 'json' ) | $raw %];
126             KohaTable("#course-items-table", {
127                 "dom": '<"top"<"table_controls"f>>t',
128                 "sorting": [[ 1, "asc" ]],
129                 "autoWidth": false,
130                 "language": {
131                     "search": "_INPUT_",
132                     "searchPlaceholder": _("Search course reserves")
133                 }
134             }, columns_settings );
135         });
136     </script>
137 [% END %]