Bug 11810: Input fields in OPAC suggestion form are a bit short (Bootstrap)
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-basket.tt
1 [% USE Koha %]
2 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %]
3
4 [% INCLUDE 'doc-head-open.inc' %]
5 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 <body id="basket">
10     <div class="main">
11         <div class="container-fluid">
12             <div class="row-fluid">
13                 <div class="span12">
14                     <div id="userbasket">
15                         <h2>Your cart</h2>
16
17                         [% UNLESS ( print_basket ) %]
18                             <div id="toolbar" class="toolbar">
19                                 [% IF ( verbose ) %]
20                                     <a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>
21                                 [% ELSE %]
22                                     <a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More details</a>
23                                 [% END %]
24                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
25                                     <a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a>
26                                 [% END %]
27                                 <a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a>
28                                 <a class="print-large" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a>
29                                 <a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and close</a>
30                                 <a class="hide close" href="opac-basket.pl">Hide window</a>
31                             </div>
32
33                             <div id="selections-toolbar" class="toolbar">
34                                 <a id="CheckAll" href="#">Select all</a>
35                                 <a id="CheckNone" href="#">Clear all</a>
36                                 <span class="sep">|</span>
37                                 <span class="links" id="tag_hides">
38                                     <span id="selections">Select titles to: </span>
39                                     <a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
40                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
41                                         [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
42                                             <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
43                                         [% END %]
44                                         [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
45                                             <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>
46                                         [% END %]
47                                         [% IF ( TagsInputEnabled && loggedinusername ) %]
48                                             <a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>
49                                         [% END %]
50                                     [% END # / IF opacuserlogin %]
51                                 </span>
52                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
53                                 <span id="tagsel_form" style="display:none">
54                                     <label for="tagsel_new">New tag:</label>
55                                     <input name="tagsel_new" id="tagsel_new" maxlength="100" />
56                                     <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" onclick="tagAdded(); return false;" />
57                                     <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;">Cancel</a>
58                                 </span>
59                                 [% END %]
60                             </div>
61                         [% END # / UNLESS print_basket %]
62
63                         [% IF ( verbose ) %]
64                             <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
65                                 [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
66                                     <h3>
67                                         [% IF ( print_basket ) %]
68                                             [% BIBLIO_RESULT.title |html %]
69                                                 [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
70                                                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
71                                         [% ELSE %]
72                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked)" />
73                                                 [% BIBLIO_RESULT.title |html %]
74                                                 [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
75                                                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
76                                         [% END # / IF print_basket %]
77                                     </h3>
78                                     <!-- COinS / Openurl -->
79                                     <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
80
81                                     <table class="table">
82                                         [% IF ( BIBLIO_RESULT.isbn ) %]
83                                             <tr>
84                                                 <th scope="row">ISBN</th>
85                                                 <td>[% BIBLIO_RESULT.isbn %]</td>
86                                             </tr>
87                                         [% END %]
88
89                                         [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
90                                         <tr>
91                                             <th scope="row">Author(s)</th>
92                                             <td>
93                                                [% IF ( BIBLIO_RESULT.author ) %]
94                                                    <p>[% BIBLIO_RESULT.author %]</p>
95                                                [% END %]
96                                                [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
97                                                    [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
98                                                    <p> [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
99                                                           [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
100                                                               [% MARCAUTHOR_SUBFIELDS_LOO.value %]
101                                                        [% END %]
102                                                    </p>
103                                                    [% END %]
104                                                [% END %]
105                                             </td>
106                                         </tr>
107                                         [% END %]
108
109                                         [% IF ( BIBLIO_RESULT.publishercode ) %]
110                                             <tr>
111                                                 <th scope="row">Publisher</th>
112                                                 <td>[% BIBLIO_RESULT.place %] [% BIBLIO_RESULT.publishercode %] [% BIBLIO_RESULT.publicationyear %]
113                                                 </td>
114                                             </tr>
115                                         [% END %]
116
117                                         [% IF ( BIBLIO_RESULT.pages ) %]
118                                             <tr>
119                                                 <th scope="row">Details</th>
120                                                 <td>[% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.size %]</td>
121                                             </tr>
122                                         [% END %]
123
124                                         [% IF ( BIBLIO_RESULT.seriestitle ) %]
125                                         <tr>
126                                             <th scope="row">Collection</th>
127                                             <td> [% BIBLIO_RESULT.seriestitle %]</td>
128                                         </tr>
129                                         [% END %]
130
131                                         [% IF ( BIBLIO_RESULT.MARCSUBJCTS ) %]
132                                         <tr>
133                                             <th scope="row">Subject(s)</th>
134                                             <td>[% FOREACH MARCSUBJCT IN BIBLIO_RESULT.MARCSUBJCTS %]
135                                                    <p> [% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
136                                                         [% MARCSUBJECT_SUBFIELDS_LOO.separator %][% MARCSUBJECT_SUBFIELDS_LOO.value %][% END %]
137                                                    </p>
138                                                 [% END %]</td>
139                                         </tr>
140                                         [% END %]
141
142                                         [% IF ( BIBLIO_RESULT.copyrightdate ) %]
143                                             <tr><th scope="row">Copyright</th>
144                                                 <td> [% BIBLIO_RESULT.copyrightdate %]</td>
145                                             </tr>
146                                         [% END %]
147
148                                         [% IF ( BIBLIO_RESULT.MARCNOTES ) %]
149                                             <tr>
150                                                 <th scope="row">Notes</th>
151                                                 <td>
152                                                 [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %]
153                                                     <p>- [% MARCNOTE.marcnote %]</p>
154                                                 [% END %]</td>
155                                             </tr>
156                                         [% END %]
157
158                                         [% IF ( BIBLIO_RESULT.unititle ) %]
159                                             <tr>
160                                                 <th scope="row">Unified title</th>
161                                                 <td> [% BIBLIO_RESULT.unititle %]</td>
162                                             </tr>
163                                         [% END %]
164
165                                         [% IF ( BIBLIO_RESULT.serial ) %]
166                                             <tr>
167                                                 <th scope="row">Serial</th>
168                                                 <td>[% BIBLIO_RESULT.serial %]</td>
169                                             </tr>
170                                         [% END %]
171
172                                         [% IF ( BIBLIO_RESULT.dewey ) %]
173                                             <tr>
174                                                 <th scope="row">Dewey</th>
175                                                 <td>[% BIBLIO_RESULT.dewey %]</td>
176                                             </tr>
177                                         [% END %]
178
179                                         [% IF ( BIBLIO_RESULT.classification ) %]
180                                             <tr>
181                                                 <th scope="row">Classification</th>
182                                                 <td> [% BIBLIO_RESULT.classification %]</td>
183                                             </tr>
184                                         [% END %]
185
186                                         [% IF ( BIBLIO_RESULT.lccn ) %]
187                                             <tr>
188                                                 <th scope="row">LCCN</th>
189                                                 <td> [% BIBLIO_RESULT.lccn %]</td>
190                                             </tr>
191                                         [% END %]
192
193                                         [% IF ( BIBLIO_RESULT.MARCurlS ) %]
194                                             <tr>
195                                                 <th scope="row">URL(s)</th>
196                                                 <td>
197                                                    [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
198                                                         <p>
199                                                         [% IF ( MARCurl.part ) %][% MARCurl.part %]
200                                                             <br />
201                                                         [% END %]
202
203                                                         [% MARCurl.MARCurl %]
204                                                             [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
205                                                         [% END %]
206                                                         </p>
207                                                 </td>
208                                             </tr>
209                                         [% END %]
210
211                                         <tr>
212                                             <th scope="row">Location(s) (Status)</th>
213                                             <td>
214                                                 [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]
215                                                     <ul>
216                                                         [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
217                                                             <li>
218                                                                 <strong>[% ITEM_RESULT.branchname %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
219                                                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
220                                                                     ([% ITEM_RESULT.itemcallnumber %])
221                                                                 [% END %]
222                                                                 ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
223                                                             </li>
224                                                         [% END %]
225                                                     </ul>
226                                                 [% ELSE %]
227                                                     This record has no items.
228                                                 [% END %]
229                                             </td>
230                                         </tr>
231                                     </table>
232                                 [% END # / FOREACH BIBLIO_RESULT %]
233                             </form>
234
235                         [% ELSE %]
236
237                             <form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
238                                 <table id="itemst" class="table table-bordered table-striped">
239                                     <thead>
240                                         <tr>
241                                             [% UNLESS ( print_basket ) %]<th>&nbsp;</th>[% END %]
242                                             <th>Title</th>
243                                             <th>Author</th>
244                                             <th>Year</th>
245                                             <th>Location (Status)</th>
246                                         </tr>
247                                     </thead>
248                                     <tbody>
249                                     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
250                                         <tr>
251                                             [% UNLESS ( print_basket ) %]
252                                                 <td>
253                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked);" />
254                                                 </td>
255                                             [% END %]
256                                             <td>
257                                                 <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a>
258                                                 <!-- COinS / Openurl -->
259                                                 <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
260                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
261                                                 <span id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
262                                                 [% END %]
263                                             </td>
264                                             <td>[% BIBLIO_RESULT.author %]</td>
265                                             <td>
266                                                 [% IF ( BIBLIO_RESULT.publicationyear ) %]
267                                                     [% BIBLIO_RESULT.publicationyear %]
268                                                 [% ELSE %]
269                                                     [% BIBLIO_RESULT.copyrightdate %]
270                                                 [% END %]
271                                             </td>
272                                             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
273                                                 <li>
274                                                     [% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
275                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
276                                                         ([% ITEM_RESULT.itemcallnumber %])
277                                                     [% END %]
278                                                     ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
279                                                 </li>
280                                                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
281                                             </td>
282                                         </tr>
283                                     [% END # / FOREACH BIBLIO_RESULT %]
284                                     </tbody>
285                                 </table>
286                             </form>
287                         [% END # / verbose %]
288
289                         [% UNLESS ( print_basket ) %]
290                             <form name="myform" action="opac-basket.pl" method="get">
291                                 <input type="hidden" name="records" id="records" />
292                             </form>
293                         [% END %]
294
295                 </div> <!-- / #userbasket -->
296             </div> <!-- / .span10 -->
297         </div> <!-- / .row-fluid -->
298     </div> <!-- / .container-fluid -->
299 </div> <!-- / .main -->
300
301 [% INCLUDE 'opac-bottom.inc' %]
302
303 [% BLOCK jsinclude %]
304     [% IF ( print_basket ) %]
305         <script type="text/javascript">
306             //<![CDATA[
307                 $(document).ready(function(){
308                     print();
309                     location.href="/cgi-bin/koha/opac-basket.pl?bib_list=[% bib_list %][% IF ( verbose ) %]&verbose=1[% END %]";
310                 });
311             //]]>
312         </script>
313     [% ELSE %]
314         <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
315         [% INCLUDE 'datatables.inc' %]
316         <script type="text/javascript">
317             //<![CDATA[
318
319             [% IF ( TagsInputEnabled && loggedinusername ) %]
320                 function tagSelected() {
321                     var bibs = document.getElementById('records').value;
322                     if (bibs) {
323                         $("#tagsel_tag").hide();
324                         $("#tag_hides").hide();
325                         $("#tagsel_form").show();
326                     } else {
327                         alert(MSG_NO_RECORD_SELECTED);
328                     }
329                 }
330
331                 function tagCanceled() {
332                     $("#tagsel_form").hide();
333                     $("#tagsel_tag").show();
334                     $("#tag_hides").show();
335                     $("#tagsel_new").val("");
336                     $(".tagstatus").empty().hide();
337                 }
338
339                 function tagAdded() {
340                     var checkedBoxes = $("input:checkbox:checked");
341                     if (!$(checkedBoxes).size()) {
342                         alert(MSG_NO_RECORD_SELECTED);
343                         return false;
344                     }
345
346                     var tag = $("#tagsel_new").val();
347                     if (!tag || (tag == "")) {
348                         alert(MSG_NO_TAG_SPECIFIED);
349                         return false;
350                     }
351
352                     var bibs = [];
353                     for (var i = 0; i < $(checkedBoxes).size(); i++) {
354                         var box = $(checkedBoxes).get(i);
355                         bibs[i] = $(box).val();
356                     }
357
358                     KOHA.Tags.add_multitags_button(bibs, tag);
359                     return false;
360                 }
361             [% END # / TagsInputEnabled && loggedinusername %]
362
363             $(document).ready(function(){
364                 $("#CheckAll").click(function(){
365                     var checked = [];
366                     $(".checkboxed").checkCheckboxes("*", true).each(
367                         function() {
368                             selRecord(this.value,true);
369                         }
370                     );
371                     enableCheckboxActions();
372                     return false;
373                 });
374
375                 $("#CheckNone").click(function(){
376                     var checked = [];
377                     $(".checkboxed").unCheckCheckboxes("*",true).each(
378                         function() {
379                             selRecord(this.value,false);
380                         }
381                     );
382                     enableCheckboxActions();
383                     return false;
384                 });
385
386                 $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
387                     "aaSorting": [[ 1, "asc" ]],
388                     "aoColumnDefs": [
389                       { "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false }
390                     ],
391                     "aoColumns": [
392                         null,
393                         { "sType": "anti-the" },
394                         null,
395                         null,
396                         null
397                     ]
398                 }));
399
400                 $(".cb").click(function(){
401                     enableCheckboxActions();
402                 });
403                 enableCheckboxActions();
404             });
405
406             function enableCheckboxActions(){
407                 // Enable/disable controls if checkboxes are checked
408                 var checkedBoxes = $(".checkboxed input:checkbox:checked");
409                 if ($(checkedBoxes).size()) {
410                   $("#selections").html(_("With selected titles: "));
411                   $("#selections-toolbar .links a").removeClass("disabled");
412                 } else {
413                   $("#selections").html(_("Select titles to: "));
414                   $("#selections-toolbar .links a").addClass("disabled");
415                 }
416             }
417             //]]>
418         </script>
419     [% END # / IF print_basket %]
420 [% END # / BLOCK jsinclude %]