kpac : added content work
authorBill Erickson <berick@esilibrary.com>
Fri, 6 Apr 2012 20:32:13 +0000 (16:32 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 30 Jul 2012 19:03:22 +0000 (15:03 -0400)
1. Consolidated added content apache configs under /eg
2. Added (untested) code to support LibraryThing reviews.
 -- It looks like we'll need to coordinate w/ LT to get it all hooked
 up.  More research pending.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/examples/apache/eg_vhost.conf
Open-ILS/src/templates/kpac/parts/acimport.tt2 [new file with mode: 0644]
Open-ILS/src/templates/kpac/parts/base.tt2
Open-ILS/src/templates/kpac/parts/chilifresh.tt2 [deleted file]
Open-ILS/src/templates/kpac/record.tt2

index 62980a2..4e2ee8f 100644 (file)
@@ -572,6 +572,23 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
 
+    #-------------------------------------------------
+    # Added Content Configuration
+    #-------------------------------------------------
+    # Content Cafe
+    #SetEnv OILS_CONTENT_CAFE_USER MYUSER
+    #SetEnv OILS_CONTENT_CAFE_PASS MYPASS
+    
+    # LibraryThing
+    #SetEnv OILS_LIBRARYTHING_URL http://ltfl.librarything.com/forlibraries/widget.js?id=MYID
+    #SetEnv OILS_LIBRARYTHING_HTTPS_URL https://ltfl.librarything.com/forlibraries/widget.js?id=MYID
+    
+    # ChiliFresh
+    #SetEnv OILS_CHILIFRESH_ACCOUNT
+    #SetEnv OILS_CHILIFRESH_URL http://chilifresh.com/on-site/js/evergreen.js
+    #SetEnv OILS_CHILIFRESH_HTTPS_URL https://secure.chilifresh.com/on-site/js/evergreen.js
+    #-------------------------------------------------
+
     <IfModule mod_deflate.c>
         SetOutputFilter DEFLATE
         BrowserMatch ^Mozilla/4 gzip-only-text/html
@@ -604,30 +621,13 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     ExpiresActive On
     ExpiresByType text/html "access plus 5 seconds"
     PerlSetVar KPacConfigFile "/openils/conf/kpac.xml.example"
-    
-    # For use with embedded Content Cafe content
-    #SetEnv OILS_CONTENT_CAFE_USER 123
-    #SetEnv OILS_CONTENT_CAFE_PASS 456
-    # Consider copying/moving other added content configs 
-    # (e.g. NOVELIST) into here or to an outer container shared by
-    # both /opac and /eg/opac since some are used in both places
 </Location>
 <Location /eg/kpac>
     PerlSetVar OILSWebContextLoader "OpenILS::WWW::EGKPacLoader"
-    # Expire the HTML quickly since we're loading dynamic data for each page
     ExpiresActive On
     ExpiresByType text/html "access plus 5 seconds"
-    
-    # For use with embedded Content Cafe content
-    #SetEnv OILS_CONTENT_CAFE_USER 123
-    #SetEnv OILS_CONTENT_CAFE_PASS 456
-    # Consider copying/moving other added content configs 
-    # (e.g. NOVELIST) into here or to an outer container shared by
-    # both /opac and /eg/opac since some are used in both places
 </Location>
 
-
-
 # Note: the template processor will decline handling anything it does not
 # have an explicit configuration for, which means it will fall back to 
 # Apache to serve the file.  However, in the interest of speed, go ahead 
diff --git a/Open-ILS/src/templates/kpac/parts/acimport.tt2 b/Open-ILS/src/templates/kpac/parts/acimport.tt2
new file mode 100644 (file)
index 0000000..7017cff
--- /dev/null
@@ -0,0 +1,29 @@
+[% 
+    # added content only shows on record detail page
+    IF ctx.page == 'record';
+
+    # chilifresh
+    IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT;
+        chili_url = ENV.OILS_CHILIFRESH_URL;
+        IF CGI.https AND ENV.OILS_CHILIFRESH_HTTPS_URL;
+            chili_url = ENV.OILS_CHILIFRESH_HTTPS_URL;
+        END %]
+    <!-- Set up the chilifresh account information and load the JS -->
+    <input type="hidden" id="chilifresh_account" name="chilifresh_account" value="[% ENV.OILS_CHILIFRESH_ACCOUNT %]"/>
+    <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
+    <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
+    <script type="text/javascript" src="[% chili_url %]"></script>
+    <script>try { setTimeout(chili_init, 0); } catch(E) {}</script>
+
+    [% END;
+
+    # LibraryThing
+    IF ENV.OILS_LIBRARYTHING_URL;
+        lt_url = ENV.OILS_LIBRARYTHING_URL;
+        IF CGI.https AND ENV.OILS_LIBRARYTHING_HTTPS_URL;
+            lt_url = ENV.OILS_LIBRARYTHING_HTTPS_URL;
+        END %]
+
+    <script src="[% lt_url %]" type="text/javascript"></script>
+    [% END %]
+[%- END %]
index e80a4c1..0685035 100644 (file)
@@ -16,6 +16,6 @@
             [% INCLUDE 'kpac/parts/footer.tt2' %]
         </div>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/kpac/functions.js"></script>
-        [%- INCLUDE 'kpac/parts/chilifresh.tt2' %]
+        [%- INCLUDE 'kpac/parts/acimport.tt2' %]
     </body>
 </html>
diff --git a/Open-ILS/src/templates/kpac/parts/chilifresh.tt2 b/Open-ILS/src/templates/kpac/parts/chilifresh.tt2
deleted file mode 100644 (file)
index 9366f60..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-[%-  IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT AND ctx.page == 'record';
-        chili_url = ENV.OILS_CHILIFRESH_URL;
-        IF CGI.https AND ENV.OILS_CHILIFRESH_HTTPS_URL;
-            chili_url = ENV.OILS_CHILIFRESH_HTTPS_URL;
-        END; 
-%]
-    <!-- Set up the chilifresh account information and load the JS -->
-    <input type="hidden" id="chilifresh_account" name="chilifresh_account" value="[% ENV.OILS_CHILIFRESH_ACCOUNT %]"/>
-    <input type="hidden" id="chilifresh_version" name="chilifresh_version" value="onsite_v1" />
-    <input type="hidden" id="chilifresh_type" name="chilifresh_type" value="search" />
-    <script type="text/javascript" src="[% chili_url %]"></script>
-    <script>try { setTimeout(chili_init, 0); } catch(E) {}</script>
-[%- END %]
index e34ea29..6388808 100644 (file)
@@ -32,6 +32,7 @@
             <div class="item_detail_rate_wrapper">
                 <div class="item_detail_rate_starts">
                     <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
+                    <span class="ltfl_reviews"/>
                 </div>
                 <!--
                 <div style="margin-bottom:20px;">