From 6c4c15cf710cae0bb7af2ff79fb768bb4347a54c Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 5 Feb 2013 12:25:24 -0500 Subject: [PATCH] TPAC: Google Books preview loader Refinements should include checking more than just the first ISBN for embeddability and passing more identifiers to the preview loader. Roughly equivalent to what JSPAC had though. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/parts/acjs.tt2 | 96 ++++++++++++++++++++++ Open-ILS/src/templates/opac/parts/config.tt2 | 5 ++ .../tpac_google_books_preview.txt | 12 +++ 3 files changed, 113 insertions(+) create mode 100644 docs/RELEASE_NOTES_NEXT/tpac_google_books_preview.txt diff --git a/Open-ILS/src/templates/opac/parts/acjs.tt2 b/Open-ILS/src/templates/opac/parts/acjs.tt2 index fe15569e22..33ab4b75c8 100644 --- a/Open-ILS/src/templates/opac/parts/acjs.tt2 +++ b/Open-ILS/src/templates/opac/parts/acjs.tt2 @@ -52,4 +52,100 @@ END; # IF ident %] +[%- IF ctx.google_books_preview -%] + +[%- END %] diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index b0fee8f9a3..e334975330 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -128,4 +128,9 @@ search.basic_config = { none_label => l("All Formats"), }; +############################################################################## +# Show Google Book Previews +# Set to 1 or 'true' to enable +ctx.google_books_preview = 0; + %] diff --git a/docs/RELEASE_NOTES_NEXT/tpac_google_books_preview.txt b/docs/RELEASE_NOTES_NEXT/tpac_google_books_preview.txt new file mode 100644 index 0000000000..c56582572c --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/tpac_google_books_preview.txt @@ -0,0 +1,12 @@ +TPAC: Google Books preview +========================== + +Setting `ctx.google_books_preview` to `1` in the TPAC `config.tt2` +configuration file will cause the TPAC to check to see, as part of the record +details view, if Google Books has an online preview available. If it does, +then a preview button will be displayed in the book cover image location. +If the user then clicks the preview button, the preview will load below the +title of the book in the record details page. + +By default, this functionality is disabled to protect the privacy of users +who might not want to share their browsing behaviour with Google. -- 2.11.0