2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › RecordedBooks search for '[% q | html %]'</title>
4 [% INCLUDE 'doc-head-close.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/jquery.rating.css" />
14 [% INCLUDE 'bodytag.inc' bodyid='recordedbooks-results-page' bodyclass='scrollto' %]
15 [% INCLUDE 'masthead.inc' %]
18 <ul class="breadcrumb">
19 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
20 <li><a href="#">RecordedBooks search for '[% q | html %]'</a></li>
23 <div class="container-fluid">
24 <div class="row-fluid">
26 [% IF ( OpacNav || OpacNavBottom ) %]
27 [% INCLUDE 'navigation.inc' %]
31 <div id="recordedbooks-results-content" class="maincontent searchresults">
32 <h1>RecordedBooks search for '[% q | html %]'</h1>
33 <div id="breadcrumbs">
38 <div class="pagination pagination-small">
42 <table id="recordedbooks-results-list" class="table table-striped">
47 <div id="bottom-pages">
48 <div class="pagination pagination-small">
52 </div> <!-- / #recordedbooks-results-content -->
53 </div> <!-- / .span10 -->
54 </div> <!-- / .row-fluid -->
55 </div> <!-- / .container-fluid -->
56 </div> <!-- / .main -->
58 [% INCLUDE 'recordedbooks-checkout.inc' %]
60 [% INCLUDE 'opac-bottom.inc' %]
62 <script type="text/javascript" src="[% interface %]/[% theme %]/js/recordedbooks.js"></script>
63 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>
64 <script type="text/javascript">
65 var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( '\r', '\\r' ) |html %]";
66 var results_per_page = [% OPACnumSearchResults || 20 %];
68 function search( page ) {
69 $( '#recordedbooks-status' ).html( _("Searching RecordedBooks...") + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' );
71 KOHA.RecordedBooks.search( querystring, results_per_page, page, function( data ) {
73 $( '#recordedbooks-status' ).html( '<strong class="unavailable">' + _("Error searching RecordedBooks collection") + ': ' + data.error + '</strong>' );
78 $( '#recordedbooks-status' ).html( '<strong>' + _("No results found in the library's RecordedBooks collection.") + '</strong>' );
82 $( '#recordedbooks-results-list tbody' ).empty();
84 $( '#recordedbooks-status' ).html( '<strong>' + _("Found") + ' ' + data.total + ' ' + _("results in the library's RecordedBooks collection.") + '</strong>' );
86 for ( var i = 0; data.items[i]; i++ ) {
87 var prod = data.items[i];
90 results.push( '<tr>' );
92 results.push( '<td class="info"><span class="title">' );
93 if (prod.url) results.push( '<a href="', prod.url, '" target="recordedbooks">' );
94 results.push( prod.title );
95 if (prod.url) results.push( '</a>' );
96 results.push( '</span>' );
97 results.push( '<p>' + _("by") + ' ', prod.author, '</p>' );
98 if (prod.description) results.push( '<p>' + prod.description, '</p>' );
99 results.push( '<span class="results_summary mediatype"><span class="label">' + _("Type:") + ' </span>', prod.media, '</span>' );
101 results.push( '</td>' );
103 results.push( '<td>' );
104 if ( prod.images && prod.images.medium ) {
105 if (prod.url) results.push( '<a href="', prod.url, '" target="recordedbooks">' );
106 results.push( '<img class="thumbnail" src="', prod.images.medium, '" />' );
107 if (prod.url) results.push( '</a>' );
109 results.push( '</td>' );
111 results.push( '</tr>' );
112 var $tr = $( results.join( '' ));
113 $( '#recordedbooks-results-list tbody' ).append( $tr );
115 $tr.find( '.info' ).each(function() {
116 KOHA.RecordedBooks.add_actions(this, prod.isbn);
120 $( '#recordedbooks-results-list tr:odd' ).addClass( 'highlight' );
124 var max_page = Math.floor( data.total / results_per_page );
125 if (data.total == page*results_per_page) max_page++;
128 pages.push( '<li><a class="od-nav" href="#" data-page="' + (page - 1) + '">« ' + _("Previous") + '</a></li>' );
131 for ( var p = Math.max( 0, page - 9 ); p <= Math.min( max_page, p + 9 ); p++ ) {
133 pages.push( ' <li class="active"><a href="#">' + ( p + 1 ) + '</a></li>' );
135 pages.push( ' <li><a class="od-nav" href="#" data-page="' + p + '">' + p + '</a></li>' );
139 if ( page < max_page ) {
140 pages.push( ' <li><a class="od-nav" href="#" data-page="' + (page + 1) + '">' + _("Next") + ' »</a></li>' );
143 if ( pages.length > 1 ) $( '#top-pages, #bottom-pages' ).find( '.pagination' ).html( '<ul>' + pages.join( '' ) + '</ul>');
145 $( '#recordedbooks-results-list input.star' ).rating();
149 $( document ).ready( function() {
150 $( '#breadcrumbs p' )
152 .append( '<span id="recordedbooks-status"></span>' );
154 $( document ).on( 'click', 'a.od-nav', function() {
155 search( $( this ).data( 'page' ) );
159 [% IF ( loggedinusername ) %]
160 KOHA.RecordedBooks.with_account_details("#breadcrumbs", function() {