Bug 28101: Update breadcrumb markup in the OPAC for consistency and accessibility
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-illrequests.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Your interlibrary loan requests &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
9 </head>
10 [% INCLUDE 'bodytag.inc' bodyid='opac-illrequests' bodyclass='scrollto' %]
11 [% BLOCK messages %]
12     [% IF message == "1" %]
13         <div class="alert alert-success" role="alert">Request updated</div>
14     [% ELSIF message == "2" %]
15         <div class="alert alert-success" role="alert">Request placed</div>
16     [% END %]
17 [% END %]
18 [% INCLUDE 'masthead.inc' %]
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             [% IF ( logged_in_user ) %]
26                 <li class="breadcrumb-item">
27                     <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
28                 </li>
29             [% END %]
30
31             [% IF method != 'list' %]
32                 <li class="breadcrumb-item active">
33                     <a href="/cgi-bin/koha/opac-illrequests.pl">Interlibrary loan requests</a>
34                 </li>
35                 [% IF method == 'create' %]
36                     <li class="breadcrumb-item active">
37                         <a href="#" aria-current="page">New interlibrary loan request</a>
38                     </li>
39                 [% ELSIF method == 'view' %]
40                     <li class="breadcrumb-item active">
41                         <a href="#" aria-current="page">View interlibrary loan request</a>
42                     </li>
43                 [% END %]
44             [% ELSE %]
45                 <li class="breadcrumb-item active">
46                     <a href="#" aria-current="page">Interlibrary loan requests</a>
47                 </li>
48             [% END %]
49         </ol> <!-- / .breadcrumb -->
50     </nav> <!-- /#breadcrumbs -->
51
52     <div class="container-fluid">
53         <div class="row">
54             [% IF ( OpacNav||loggedinusername ) && !print %]
55                 <div class="col-lg-2">
56                     <div id="navigation">
57                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
58                     </div>
59                 </div>
60             [% END %]
61
62             [% IF ( OpacNav||loggedinusername ) %]
63                 <div class="col-lg-10 order-first order-md-first order-lg-2">
64             [% ELSE %]
65                 <div class="col order-first order-md-first order-lg-2">
66             [% END %]
67
68                 [% IF !backends_available %]
69                     <div class="alert alert-warning">ILL module configuration problem. Contact your administrator.</div>
70                 [% ELSE %]
71                     <div id="illrequests" class="maincontent">
72                         [% IF method == 'create' %]
73                             <h1>New interlibrary loan request</h1>
74                             [% IF stage == 'copyrightclearance' %]
75                                 [% INCLUDE messages %]
76                                 <div>
77                                     <p>
78                                         [% Koha.Preference('ILLModuleCopyrightClearance') | $raw %]
79                                     </p>
80                                     [% USE link_url = url('/cgi-bin/koha/opac-illrequests.pl', whole.value.other) %]
81                                     <a href="[% link_url _ '&amp;stage=copyrightclearance' | $raw %]"
82                                     class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Yes</a>
83                                     <a href="/cgi-bin/koha/opac-illrequests.pl"
84                                     class="btn btn-sm btn-danger"><i class="fa fa-times" aria-hidden="true"></i> No</a>
85                                 </div>
86                             [% ELSE %]
87                                 [% INCLUDE messages %]
88                                 [% IF backends %]
89                                     <form method="post" id="illrequestcreate-form" novalidate="novalidate">
90                                         <legend class="sr-only">Backends</legend>
91                                         <fieldset class="rows">
92                                             <label for="backend">Provider:</label>
93                                             <select name="backend">
94                                                 [% FOREACH backend IN backends %]
95                                                     <option value="[% backend | html %]">[% backend | html %]</option>
96                                                 [% END %]
97                                             </select>
98                                         </fieldset>
99                                         <fieldset class="action">
100                                             <input type="hidden" name="method" value="create" />
101                                             <input type="submit" name="create_select_backend" value="Next" />
102                                         </fieldset>
103                                     </form>
104                                 [% ELSE %]
105                                     [% PROCESS $whole.opac_template %]
106                                 [% END %]
107                             [% END # /IF stage == 'copyrightclearance' %]
108                         [% ELSIF method == 'list' %]
109                             <h1>Interlibrary loan requests</h1>
110                             [% INCLUDE messages %]
111
112                             <div id="illrequests-create-button" class="dropdown btn-group">
113                                 [% IF backends.size > 1 %]
114                                         <button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
115                                             <i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>
116                                         </button>
117                                         <div id="backend-dropdown-options" class="dropdown-menu nojs" aria-labelledby="ill-backend-dropdown">
118                                             [% FOREACH backend IN backends %]
119                                                 <a class="dropdown-item" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backend | uri %]">[% backend | html %]</a>
120                                             [% END %]
121                                         </div>
122                                 [% ELSE %]
123                                     <a id="ill-new" class="btn btn-primary" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=[% backends.0 | html %]">
124                                         <i class="fa fa-plus" aria-hidden="true"></i> Create a new request
125                                     </a>
126                                 [% END %]
127                             </div>
128
129                             <table id="illrequestlist" class="table table-bordered table-striped">
130                                 <caption class="sr-only">Requests</caption>
131                                 <thead>
132                                     <tr>
133                                         <th>Request ID</th>
134                                         <th>Author</th>
135                                         <th>Title</th>
136                                         <th>Requested from</th>
137                                         <th>Request type</th>
138                                         <th>Status</th>
139                                         <th>Request placed</th>
140                                         <th>Last updated</th>
141                                         <th></th>
142                                     </tr>
143                                 </thead>
144                                 <tbody>
145                                     [% FOREACH request IN requests %]
146                                         [% status = request.status | html %]
147                                         [% type = request.get_type %]
148                                         <tr>
149                                             <td>[% request.id | html %]</td>
150                                             <td>
151                                                 [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]<span>N/A</span>[% END %]
152                                             </td>
153                                             <td>
154                                                 [% IF request.metadata.Title %][% request.metadata.Title | html %][% ELSE %]<span>N/A</span>[% END %]
155                                             </td>
156                                             <td>[% request.backend | html %]</td>
157                                             <td>
158                                                 [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
159                                             </td>
160                                             <td>[% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]</td>
161                                             <td data-order="[% request.placed | html %]">[% request.placed | $KohaDates %]</td>
162                                             <td data-order="[% request.updated | html %]">[% request.updated | $KohaDates %]</td>
163                                             <td>
164                                                 <a href="/cgi-bin/koha/opac-illrequests.pl?method=view&amp;illrequest_id=[% request.id | uri %]" class="btn btn-primary btn-sm pull-right">View</a>
165                                             </td>
166                                         </tr>
167                                     [% END %]
168                                 </tbody>
169                             </table>
170                         [% ELSIF method == 'view' %]
171                             <h1>View interlibrary loan request</h1>
172                             [% INCLUDE messages %]
173                             [% status = request.status %]
174                             <form method="post" action="?method=update" id="illrequestupdate-form" novalidate="novalidate">
175                                 <fieldset class="rows">
176                                     <legend id="library_legend">Details from library</legend>
177                                     <ol>
178                                         [% type = request.get_type %]
179                                         <li>
180                                             <label for="request_id">Request ID:</label>
181                                             [% request.id | html %]
182                                         </li>
183                                         <li>
184                                             <label for="backend">Requested from:</label>
185                                             [% request.backend | html %]
186                                         </li>
187                                         [% IF request.biblio_id %]
188                                             <li>
189                                                 <label for="biblio">Requested item:</label>
190                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% request.biblio_id | uri %]">View the requested item</a>
191                                             </li>
192                                         [% END %]
193                                         <li>
194                                             <label for="branchcode">Collection library:</label>
195                                             [% Branches.GetName(request.branchcode) | html %]
196                                         </li>
197                                         <li>
198                                             <label for="status">Status:</label>
199                                             [% request.status_alias ? request.statusalias.lib_opac : request.capabilities.$status.name | html %]
200                                         </li>
201                                         <li>
202                                             <label for="medium">Request type:</label>
203                                             [% IF type %][% type | html %][% ELSE %]<span>N/A</span>[% END %]
204                                         </li>
205                                         <li>
206                                             <label for="placed">Request placed:</label>
207                                             [% request.placed | $KohaDates %]
208                                         </li>
209                                         <li>
210                                             <label for="updated">Last updated:</label>
211                                             [% request.updated | $KohaDates %]
212                                         </li>
213                                         <li>
214                                             <label for="notesopac">Notes:</label>
215                                             [% IF !request.completed %]
216                                                 <textarea name="notesopac" rows="5" cols="50">[% request.notesopac | html %]</textarea>
217                                             [% ELSE %]
218                                                 [% request.notesopac | html %]
219                                             [% END %]
220                                         </li>
221                                     </ol>
222                                 </fieldset>
223                                 <div class="rows">
224                                     <legend id="backend_legend">Details from [% request.backend | html %]</legend>
225                                     [% FOREACH meta IN request.metadata %]
226                                         <div class="requestattr-[% meta.key | html %]">
227                                             <span class="label">[% meta.key | html %]:</span>
228                                             [% IF meta.value %][% meta.value | html %][% ELSE %]<span>N/A</span>[% END %]
229                                         </div>
230                                     [% END %]
231                                 </div>
232                                 <fieldset class="action illrequest-actions">
233                                     <input type="hidden" name="illrequest_id" value="[% request.illrequest_id | html %]" />
234                                     <input type="hidden" name="method" value="update" />
235                                     [% IF !request.completed %]
236                                         [% IF request.status == "NEW" %]
237                                             <a class="cancel-illrequest btn btn-danger" href="/cgi-bin/koha/opac-illrequests.pl?method=cancreq&amp;illrequest_id=[% request.illrequest_id | html %]">Request cancellation</a>
238                                         [% END %]
239                                         <input type="submit" class="update-illrequest btn btn-primary" value="Submit modifications" />
240                                     [% END %]
241                                     <span class="cancel"><a href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a></span>
242                                 </fieldset>
243                             </form>
244                         [% ELSIF method == 'availability' %]
245                             <h1>Interlibrary loan item availability</h1>
246                             <div id="results">
247                                 <form method="POST" action="/cgi-bin/koha/opac-illrequests.pl">
248                                     <legend><h2>Displaying availability results</h2></legend>
249                                     [% FOREACH key IN whole.keys %]
250                                         [% value = whole.$key %]
251                                         [% IF key != 'custom_key' && key != 'custom_value' %]
252                                         <input type="hidden" name="[% key | html %]" value="[% value | html %]">
253                                         [% END %]
254                                     [% END %]
255                                     [% custom_keys = whole.custom_key.split('\0') %]
256                                     [% custom_values = whole.custom_value.split('\0') %]
257                                     [% i = 0 %]
258                                     [% FOREACH custom_key IN custom_keys %]
259                                         <input type="hidden" name="custom_key" value="[% custom_key | html %]">
260                                         <input type="hidden" name="custom_value" value="[% custom_values.$i | html %]">
261                                     [% i = i + 1 %]
262                                     [% END %]
263                                     <input type="hidden" name="checked_availability" value="1">
264                                     <div id="continue-request-row" class="alert">
265                                         If you can't find what you are looking for, you can
266                                         <button class="button" type="submit">continue creating your request</button> or
267                                         <a href="/cgi-bin/koha/opac-illrequests.pl">cancel your request</a>
268                                     </div>
269                                 </form>
270                                 [% FOR service IN services %]
271                                     <h3 class="ill_availability_sourcename">[% service.name | html %]</h3>
272                                     [% INCLUDE 'ill-availability-table.inc' service=service %]
273                                 [% END %]
274                             </div> <!-- /#illrequestupdate-form -->
275                         [% END # / IF method == 'create' %]
276                     </div> <!-- / #illrequests -->
277                 [% END # /IF !backends_available %]
278             </div> <!-- / .col-lg-10/12 -->
279         </div> <!-- / .row -->
280     </div> <!-- / .container-fluid -->
281 </div> <!-- / .main -->
282
283 [% INCLUDE 'opac-bottom.inc' %]
284
285 [% BLOCK jsinclude %]
286     [% INCLUDE 'datatables.inc' %]
287     <script>
288         $("#illrequestlist").dataTable($.extend(true, {}, dataTablesDefaults, {
289             "columnDefs": [
290                 { "targets": [ -1 ], "sortable": false, "searchable": false }
291             ],
292             "order": [[ 3, "desc" ]],
293             "deferRender": true
294         }));
295         $("#backend-dropdown-options").removeClass("nojs");
296         [% IF services_json.length > 0 %]
297             var services = [% services_json | $raw %];
298         [% ELSE %]
299             var services = [];
300         [% END %]
301         [% IF metadata.length > 0 %]
302             var metadata = "[% metadata | $raw %]";
303         [% END %]
304     </script>
305     [% IF method == 'availability' %]
306         [% Asset.js("js/ill-availability.js") | $raw %]
307         <script>
308             $(document).ready(function() {
309                 window.doSearch();
310             });
311         </script>
312     [% END %]
313     [% TRY %]
314         [% PROCESS backend_jsinclude %]
315     [% CATCH %]
316     [% END %]
317 [% END %]