OPAC: Added Content Updates rel_3_6_0_opac_new_added_content
authorTerran McCanna <tmccanna@georgialibraries.org>
Tue, 17 Nov 2020 20:58:32 +0000 (15:58 -0500)
committerTerran McCanna <tmccanna@georgialibraries.org>
Tue, 17 Nov 2020 20:58:32 +0000 (15:58 -0500)
This updates the Syndetics section to pull in full content instead of
screen-scraping it, and expands the NoveList section by default.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates-bootstrap/opac/parts/record/addedcontent.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/extras.tt2

index 05f640d..8b1c086 100755 (executable)
-<div class='rdetail_extras_div'>
-
-[%
-    ac_types = {
-        reviews => l('Reviews'),
-        anotes  => l('Author Notes'),
-        toc     => l('Table of Contents'),
-        excerpt => l('Excerpt'),
-        summary => l('Summary')
-    };
-
-    selected_type = CGI.param('ac');
-
-    # For each type of added content, render the link if it's known to have
-    # content, do not render the link if it's known to not have content.  If
-    # the content status is unknown, render the link, but hide the link via CSS
-    # if dojo is enabled.  If dojo is not enabled, render and display the link.
-%]
-
-    <div id='ac_tab_wrapper'>
-    [%
-        all_hidden = 1;
-        FOR type IN ac_types.keys;
-            tab_class = 'ac_tab';
-            SET tab_class = tab_class _ ' ac_tab_selected' IF type == selected_type;
-            IF ctx.added_content.$type.status != '2'; # no content
-                all_hidden = 0;
-                IF ctx.added_content.$type.status == '3' AND want_dojo; # status unknown
-                    tab_class = tab_class _ ' hidden';
-                END %]
-            <div class="[% tab_class %]" id="ac:[% type %]">
-                <a href="[% mkurl('', {ac => type}) _ '#addedcontent' %]" rel="nofollow" vocab="">[% ac_types.$type %]</a>
-            </div>
-            [% END;
-        END;
-    %]
-    </div>
+<!-- PINES CUSTOMIZATION: Use complete Syndetic content in modal pop-up instead of screenscraped from page -->
+[% IF attrs.isbn_clean || attrs.upc || attrs.issn %]
+    <style>
+        /* The Syndetics Modal Stylesheet */
+        .smodal {
+            display: none; /* Hidden by default */
+            position: fixed; /* Stay in place */
+            z-index: 1; /* Sit on top */
+            padding-top: 30px; /* Location of the box */
+            left: 0;
+            top: 0;
+            width: 100%; /* Full width */
+            height: 100%; /* Full height */
+            overflow: auto; /* Enable scroll if needed */
+            background-color: rgb(0,0,0); /* Fallback color */
+            background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
+        }
+
+        /* Modal Content */
+        .smodal-content {
+            background-color: #fefefe;
+            margin: auto;
+            padding: 0px;
+            border: 1px solid #888;
+            width: 80%;
+        }
+        
+        /* Iframe Content */
+        .smodal-iframe {
+            margin: auto;
+            padding:0px;
+            border: 0px;
+            width: 100%;
+            height: 600px;
+        }
+        
+        /* Launch Button */
+        .smodal-button {
+            margin: 20px;
+        }
+        
+        /* The Close Button */
+        .close {
+            color: #aaaaaa;
+            float: right;
+            font-size: 28px;
+            font-weight: bold;
+        }
+
+        .close:hover,
+        .close:focus {
+            color: #000;
+            text-decoration: none;
+            cursor: pointer;
+        }
+        
+        /* Responsive design for phones */
+        @media only screen and (max-width: 1200px) {
+
+            #sBtn {
+                display:none;
+            }
+        }
+    </style>
+
+
+    <div class='rdetail_extras_div'>
+        <button class="smodal-button" id="sBtn">See Summary, Reviews, and More from Syndetics</button>
+        <div id="sModal" class="smodal">
+          <div class="smodal-content">
+            <span class="close">&times;</span>
+            <iframe class="smodal-iframe" src="https://secure.syndetics.com/index.aspx?isbn=[%- attrs.isbn_clean -%]/index.html&client=evertest&type=rn12&close=no&popup=no&upc=[%- attrs.upc -%]&issn=[%- attrs.issn -%]">
+                <p>[% l("This browser does not support this type of content.") %]</p>    
+            </iframe>
+          </div>
+        </div>
 
-    <div id='ac_content'>
-        [%
-            IF selected_type;
-                content = ctx.added_content.$selected_type.content;
-                IF content;
-                    content;
-                ELSE;
-                    l('No Content Available');
-                END;
-            ELSIF all_hidden;
-                l('No Content Available');
-            END;
-        %]
     </div>
-</div>
 
+    <script>
+        // Get the Syndetics modal
+        var modal = document.getElementById('sModal');
+
+        // Get the button that opens the modal
+        var btn = document.getElementById("sBtn");
+
+        // Get the <span> element that closes the modal
+        var span = document.getElementsByClassName("close")[0];
+
+        // When the user clicks the button, open the modal 
+        btn.onclick = function() {
+            modal.style.display = "block";
+        }
+
+        // When the user clicks on <span> (x), close the modal
+        span.onclick = function() {
+            modal.style.display = "none";
+        }
 
+        // When the user clicks anywhere outside of the modal, close it
+        window.onclick = function(event) {
+            if (event.target == modal) {
+                modal.style.display = "none";
+            }
+        }
+    </script>
+[% END %]
\ No newline at end of file
index 48f246a..32df867 100755 (executable)
@@ -69,7 +69,7 @@
         %]
         <div class="card border-secondary col-12 p-0">
          [%
-                    IF tab_is_active(name);
+                    IF tab_is_active(name) OR name == 'awards' OR name == 'addedcontent';
                         href = mkurl('', {}, ['expand', 'ac']);
                         arrow = arrow_down;
                     ELSE;