LP#1624366 Evergreen integration with obalkyknih.cz (Czech AC provider)
authorJakub Kotrla <jakub@kotrla.net>
Thu, 5 Jan 2017 22:50:45 +0000 (23:50 +0100)
committerJakub Kotrla <jakub@kotrla.net>
Thu, 5 Jan 2017 22:50:45 +0000 (23:50 +0100)
Adding changes in tt2 template files for easier setup and comply with obalkyknih.cz license requirements.

Signed-off-by: Jakub Kotrla <jakub@kotrla.net>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/record/jackets.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/record/summary.tt2

index 87db4cc..c4a8da9 100644 (file)
@@ -295,6 +295,24 @@ vim:et:ts=4:sw=4:
             </ContentCafe>
 
             <!--
+            Segregating the details for obalkyknih.cz out for easier use.
+            -->
+            <ObalkyKnih>
+                <!-- Covers are there always -->
+
+                <!-- Annotations provided by obalkyknih.cz is mapped to evergreen summary -->
+                <summary>false</summary>
+                
+                <!-- Provider obalkyknih.cz provides TOC as text and as PDF plus thumbnail -->
+                <tocPdf>true</tocPdf>
+                <tocText>false</tocText>
+                
+                <!-- User reviews from obalkyknih.cz -->
+                <reviews>true</reviews>
+
+            </ObalkyKnih>
+
+            <!--
  
             You can add free-form settings here and they will be accessible
             within the added content module
index 58d2c09..a0da908 100644 (file)
@@ -215,4 +215,12 @@ ctx.exclude_electronic_checkbox = 0;
 # TIME_FORMAT = '%H:%M'; # for 16:32 (24 hour) format
 ##############################################################################
 
+##############################################################################
+# Obalkyknih.cz support
+##############################################################################
+# Obalkyknihy.cz is free Czech service providing added content and book covers
+# Set to 'true' to enable
+##############################################################################
+# obalkyknih_cz.enabled = 'true';
+
 %]
diff --git a/Open-ILS/src/templates/opac/parts/record/jackets.tt2 b/Open-ILS/src/templates/opac/parts/record/jackets.tt2
new file mode 100644 (file)
index 0000000..858fca1
--- /dev/null
@@ -0,0 +1,25 @@
+[%- IF obalkyknih_cz.enabled == 'true' %]
+    [%- 
+      isbnissn = '';
+      IF attrs.isbns.0;
+              isbnissn = attrs.isbns.0;
+              IF (matches = isbnissn.match('^(.+?)(\s.+)$'));
+                isbnissn = matches.0;
+              END;
+            END;
+            IF attrs.issns.0;
+              isbnissn=attrs.issns.0;
+            END;
+     %]
+        <a href='http://obalkyknih.cz/view?isbn=[% isbnissn %]'  title="[% l('Title info at Obalkyknih.cz') %]">
+            <img
+              alt="[% l('Image of item') %]" id='rdetail_image'
+              src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
+        </a>
+        <br />
+[%  ELSE %]
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
+            alt="[% l('Image of item') %]" id='rdetail_image'
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' />
+        </a>
+[%- END  %]
\ No newline at end of file
index 22ce3c2..667d379 100644 (file)
         [%- INCLUDE "opac/parts/record/authors.tt2" %]
     </div>
     <div id="rdetail_image_div">
-        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
-            alt="[% l('Image of item') %]" id='rdetail_image'
-            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
-        <br />
+       [%- INCLUDE "opac/parts/record/jackets.tt2" %]
     </div>
     <div id="format_actions">