LP1955403-Bootstrap opac - Google Books preview not rendering.
authorGarry Collum <gcollum@gmail.com>
Mon, 20 Dec 2021 12:59:27 +0000 (07:59 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 22 Nov 2022 14:57:50 +0000 (09:57 -0500)
Fixes the Google Books preview in the Bootstrap Opac.

To test.
1. Set ctx.google_books_preview=1 in config.tt2.
2. View a bibliographic record that would have an ISBN that would link to
a google book preview.  In concerto you can change and ISBN on a record to
and ISBN that you know would pull data (97880271037829781629795645).
3. Notice there is no preview button link, or preview.
4. Apply the patch and refresh.  The google preview button should render.
Clicking on the button will display the preview.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Eva Cerninakova <cerninakova@jabok.cz>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2

index 2adcf45..8c157ad 100755 (executable)
@@ -56,7 +56,8 @@ ctx.metalinks.push('
     <div class="col-lg-9">
         <div class="row h-100">
             <div class="col-lg-8">
-                <h1 class='h1' property="name">[% IF attrs.hl.title; attrs.hl.title; ELSE; attrs.title_extended | html; END %]</h1>
+                <div id="rdetail_title_div">
+                <h1 id="rdetail_title" class='h1' property="name">[% IF attrs.hl.title; attrs.hl.title; ELSE; attrs.title_extended | html; END %]</h1>
                 [%-
                 FOR link880 IN attrs.graphic_titles;
                 FOR alt IN link880.graphic;
@@ -70,6 +71,7 @@ ctx.metalinks.push('
                 -%]
                 [%- INCLUDE "opac/parts/record/authors.tt2" %]
                 [%- INCLUDE "opac/parts/record/contents-summaryonly.tt2" %]
+                </div>
                 <div>
                     <button id="btnMore" data-toggle="collapse" data-target="#demo"
                         class="btn btn-action btn-sm my-3"><i class="fas fa-info-circle" aria-hidden="true"></i> [%l ("More Details") %]</button>
@@ -78,7 +80,8 @@ ctx.metalinks.push('
                         <ul class="list-unstyled">
                             [%- IF attrs.hl.isbn.size; FOR isbn IN attrs.hl.isbn %]
                             <li class='rdetail_isbns'>
-                                <strong class='rdetail_label'>[% l('ISBN:'); %]</strong> [% isbn %]
+                                <strong class='rdetail_label'>[% l('ISBN:'); %]</strong> 
+                                <span class='rdetail_value' property='isbn'>[% isbn | html %]</span>
                             </li>
                             [%- END; ELSIF attrs.isbns.0;
                             FOR isbn IN attrs.isbns;