From 647a0d21022aa8d61c8de6894d3b02bfd3a08c40 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sat, 8 Apr 2017 09:26:42 -0400 Subject: [PATCH] LP#1681095 Browser cache-busting key for longer expires Extend the support for cache-busting that we added with autogen's generation of ctx.eg_cache_hash for core JavaScript assets to other assets such as images, stylesheets, and additional JavaScript. This will enable us to set very long cache times for our assets, which can then be controlled explicitly by setting eg.cache_key in config.tt2, or by default any time you run autogen. Addresses TPAC and KPAC Signed-off-by: Dan Scott Signed-off-by: Josh Stompro Signed-off-by: Galen Charlton --- Open-ILS/src/templates/kpac/category.tt2 | 4 ++-- Open-ILS/src/templates/kpac/getit.tt2 | 12 ++++++------ Open-ILS/src/templates/kpac/getit_results.tt2 | 4 ++-- Open-ILS/src/templates/kpac/home.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/base.tt2 | 4 ++-- Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/header.tt2 | 6 +++--- Open-ILS/src/templates/kpac/parts/help_popups.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/paginate.tt2 | 6 +++--- Open-ILS/src/templates/kpac/parts/record_row.tt2 | 6 +++--- Open-ILS/src/templates/kpac/parts/searchbox.tt2 | 2 +- Open-ILS/src/templates/kpac/parts/util.tt2 | 2 +- Open-ILS/src/templates/kpac/record.tt2 | 8 ++++---- Open-ILS/src/templates/opac/browse.tt2 | 4 ++-- Open-ILS/src/templates/opac/myopac/circ_history.tt2 | 2 +- Open-ILS/src/templates/opac/myopac/circs.tt2 | 2 +- Open-ILS/src/templates/opac/myopac/hold_history.tt2 | 2 +- Open-ILS/src/templates/opac/myopac/holds.tt2 | 4 ++-- Open-ILS/src/templates/opac/myopac/lists.tt2 | 4 ++-- Open-ILS/src/templates/opac/myopac/messages/list.tt2 | 2 +- Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 | 4 ++-- Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 | 2 +- Open-ILS/src/templates/opac/parts/advanced/expert.tt2 | 2 +- Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 | 2 +- Open-ILS/src/templates/opac/parts/advanced/search.tt2 | 2 +- Open-ILS/src/templates/opac/parts/base.tt2 | 8 ++++---- Open-ILS/src/templates/opac/parts/bookbag_actions.tt2 | 2 +- Open-ILS/src/templates/opac/parts/config.tt2 | 13 +++++++++++++ Open-ILS/src/templates/opac/parts/ebook_api/base_js.tt2 | 10 +++++----- Open-ILS/src/templates/opac/parts/footer.tt2 | 4 ++-- Open-ILS/src/templates/opac/parts/header.tt2 | 9 +++++++++ Open-ILS/src/templates/opac/parts/homesearch.tt2 | 2 +- Open-ILS/src/templates/opac/parts/js.tt2 | 6 +++--- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 2 +- Open-ILS/src/templates/opac/parts/record/copy_table.tt2 | 4 ++-- Open-ILS/src/templates/opac/parts/record/refworks.tt2 | 2 +- Open-ILS/src/templates/opac/parts/record/summary.tt2 | 12 ++++++------ Open-ILS/src/templates/opac/parts/result/table.tt2 | 8 ++++---- Open-ILS/src/templates/opac/parts/searchbar.tt2 | 2 +- Open-ILS/src/templates/opac/parts/staff_saved_searches.tt2 | 4 ++-- Open-ILS/src/templates/opac/parts/topnav_logo.tt2 | 2 +- 41 files changed, 102 insertions(+), 80 deletions(-) diff --git a/Open-ILS/src/templates/kpac/category.tt2 b/Open-ILS/src/templates/kpac/category.tt2 index b4facb08f1..fe51d6bd56 100644 --- a/Open-ILS/src/templates/kpac/category.tt2 +++ b/Open-ILS/src/templates/kpac/category.tt2 @@ -15,10 +15,10 @@ + +
- -
diff --git a/Open-ILS/src/templates/kpac/getit.tt2 b/Open-ILS/src/templates/kpac/getit.tt2 index 249d4ac4de..53056c18d3 100644 --- a/Open-ILS/src/templates/kpac/getit.tt2 +++ b/Open-ILS/src/templates/kpac/getit.tt2 @@ -18,7 +18,7 @@
[% WRAPPER 'kpac/parts/help_popups.tt2' popup_id='card_help' %] - [% l('library card') %]
+ [% l('library card') %] [% END %] [% WRAPPER 'kpac/parts/help_popups.tt2' popup_id='password_help' %]

[% l('Enter your password') %]

@@ -46,7 +46,7 @@ [% l('pin number help') %] + src="[% ctx.media_prefix %]/images/kpac/question_mark.png[% ctx.cache_key %]" alt="[% l('pin number help') %]" />
 
 
@@ -60,7 +60,7 @@ [% l('password help') %] + src="[% ctx.media_prefix %]/images/kpac/question_mark.png[% ctx.cache_key %]" alt="[% l('password help') %]" /> @@ -117,7 +117,7 @@
- +
@@ -152,7 +152,7 @@ [% END %]
- +
@@ -166,7 +166,7 @@ [% # in the absence of a sane referer, return to the detail page url = ctx.kpac_root _ (ctx.referer.match('results') ? '/results' : '/record/' _ ctx.bre_id) %] - +   diff --git a/Open-ILS/src/templates/kpac/getit_results.tt2 b/Open-ILS/src/templates/kpac/getit_results.tt2 index 70e9803710..83040dc4a6 100644 --- a/Open-ILS/src/templates/kpac/getit_results.tt2 +++ b/Open-ILS/src/templates/kpac/getit_results.tt2 @@ -41,9 +41,9 @@ - + [%- INCLUDE 'kpac/parts/acimport.tt2' %] diff --git a/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 b/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 index 4532070876..d89f819b25 100644 --- a/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 +++ b/Open-ILS/src/templates/kpac/parts/breadcrumb.tt2 @@ -4,7 +4,7 @@ [% l('Home') %] + src="[% ctx.media_prefix %]/images/kpac/home_icon.png[% ctx.cache_key %]" /> [% trail = CGI.param('trail'); diff --git a/Open-ILS/src/templates/kpac/parts/header.tt2 b/Open-ILS/src/templates/kpac/parts/header.tt2 index 588b9100ca..e632a60a7b 100644 --- a/Open-ILS/src/templates/kpac/parts/header.tt2 +++ b/Open-ILS/src/templates/kpac/parts/header.tt2 @@ -2,17 +2,17 @@
[% l('Print') %]   [% l('print') %] + alt="[% l('print') %]" src="[% ctx.media_prefix %]/images/kpac/print_btn.png[% ctx.cache_key %]" />
diff --git a/Open-ILS/src/templates/kpac/parts/help_popups.tt2 b/Open-ILS/src/templates/kpac/parts/help_popups.tt2 index 5399fb9107..95518223bc 100644 --- a/Open-ILS/src/templates/kpac/parts/help_popups.tt2 +++ b/Open-ILS/src/templates/kpac/parts/help_popups.tt2 @@ -18,7 +18,7 @@ - + diff --git a/Open-ILS/src/templates/kpac/parts/paginate.tt2 b/Open-ILS/src/templates/kpac/parts/paginate.tt2 index f5b875bde3..27844eeafe 100644 --- a/Open-ILS/src/templates/kpac/parts/paginate.tt2 +++ b/Open-ILS/src/templates/kpac/parts/paginate.tt2 @@ -17,7 +17,7 @@ IF page > 0; href = mkurl('', {page => page - 1}); ELSE; class = class _ ' invisible'; END %] - + @@ -37,13 +37,13 @@ href = mkurl('', {page => page + 1}); ELSE; class = class _ ' invisible'; END; %] - + [% IF showtop %] - + [% END %] diff --git a/Open-ILS/src/templates/kpac/parts/record_row.tt2 b/Open-ILS/src/templates/kpac/parts/record_row.tt2 index 38c39adb7f..a0d936de0d 100644 --- a/Open-ILS/src/templates/kpac/parts/record_row.tt2 +++ b/Open-ILS/src/templates/kpac/parts/record_row.tt2 @@ -1,6 +1,6 @@
- [% img_src = ctx.media_prefix _ '/images/kpac/item_image.jpg'; # default image + [% img_src = ctx.media_prefix _ '/images/kpac/item_image.jpg' _ ctx.cache_key; # default image ident = attrs.isbn_clean || attrs.upc; IF ident; img_src = ctx.media_prefix _ '/opac/extras/ac/jacket/medium/' _ ident; @@ -21,9 +21,9 @@ [% IF show_actions %]
[% l('more info') %]
+ src="[% ctx.media_prefix %]/images/kpac/more_info_btn.png[% ctx.cache_key %]" alt="[% l('more info') %]" />
[% l('get it') %]
+ src="[% ctx.media_prefix %]/images/kpac/get_it_btn_sm.png[% ctx.cache_key %]" alt="[% l('get it') %]" />
 
[% END %] diff --git a/Open-ILS/src/templates/kpac/parts/searchbox.tt2 b/Open-ILS/src/templates/kpac/parts/searchbox.tt2 index 2e1e2ec39d..a21dcbac7b 100644 --- a/Open-ILS/src/templates/kpac/parts/searchbox.tt2 +++ b/Open-ILS/src/templates/kpac/parts/searchbox.tt2 @@ -45,7 +45,7 @@
 
- +
diff --git a/Open-ILS/src/templates/kpac/parts/util.tt2 b/Open-ILS/src/templates/kpac/parts/util.tt2 index 632c1800d7..2c4734dba1 100644 --- a/Open-ILS/src/templates/kpac/parts/util.tt2 +++ b/Open-ILS/src/templates/kpac/parts/util.tt2 @@ -36,7 +36,7 @@ IF img.match('^/') OR img.match('^https?://'); img; ELSE; - ctx.media_prefix _ '/images/kpac/' _ img; + ctx.media_prefix _ '/images/kpac/' _ img _ ctx.cache_key; END; END; %] diff --git a/Open-ILS/src/templates/kpac/record.tt2 b/Open-ILS/src/templates/kpac/record.tt2 index 514c45f81e..393bb1c987 100644 --- a/Open-ILS/src/templates/kpac/record.tt2 +++ b/Open-ILS/src/templates/kpac/record.tt2 @@ -11,7 +11,7 @@
[% ident = attrs.isbn_clean || attrs.upc; - href = ctx.media_prefix _ '/images/kpac/item_image.jpg'; + href = ctx.media_prefix _ '/images/kpac/item_image.jpg[% ctx.cache_key %]'; IF ident; href = ctx.media_prefix _ '/opac/extras/ac/jacket/medium/' _ ident; END %] [% l('Image of item') %]
@@ -41,7 +41,7 @@ --> @@ -60,11 +60,11 @@
[% l('Get it') | html %] + alt="[% l('Get it') | html %]" src="[% ctx.media_prefix %]/images/kpac/get_it_btn.png[% ctx.cache_key %]" />
[% l('Go Back') | html %] + alt="[% l('Go Back') | html %]" src="[% ctx.media_prefix %]/images/kpac/go_back_btn.png[% ctx.cache_key %]" />
 
diff --git a/Open-ILS/src/templates/opac/browse.tt2 b/Open-ILS/src/templates/opac/browse.tt2 index 9d58cd07a7..ed946094a9 100644 --- a/Open-ILS/src/templates/opac/browse.tt2 +++ b/Open-ILS/src/templates/opac/browse.tt2 @@ -45,7 +45,7 @@ @@ -70,7 +70,7 @@ [% END %]
diff --git a/Open-ILS/src/templates/opac/myopac/circ_history.tt2 b/Open-ILS/src/templates/opac/myopac/circ_history.tt2 index 8e989c4362..d7f2175c52 100644 --- a/Open-ILS/src/templates/opac/myopac/circ_history.tt2 +++ b/Open-ILS/src/templates/opac/myopac/circ_history.tt2 @@ -81,7 +81,7 @@ diff --git a/Open-ILS/src/templates/opac/myopac/circs.tt2 b/Open-ILS/src/templates/opac/myopac/circs.tt2 index bd93d7bbcb..91ebeb09f4 100644 --- a/Open-ILS/src/templates/opac/myopac/circs.tt2 +++ b/Open-ILS/src/templates/opac/myopac/circs.tt2 @@ -56,7 +56,7 @@ [% l('Renewing Help') %] + src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" /> diff --git a/Open-ILS/src/templates/opac/myopac/hold_history.tt2 b/Open-ILS/src/templates/opac/myopac/hold_history.tt2 index 16b4c029b9..9f22b1dcb0 100644 --- a/Open-ILS/src/templates/opac/myopac/hold_history.tt2 +++ b/Open-ILS/src/templates/opac/myopac/hold_history.tt2 @@ -93,7 +93,7 @@
[% IF attrs.format_icon %] - [% attrs.format_label | html %] + [% attrs.format_label | html %] [% END %]
diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2 index 1ba5c9ce1b..100e806096 100644 --- a/Open-ILS/src/templates/opac/myopac/holds.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds.tt2 @@ -83,7 +83,7 @@ [% l('Holds Help') %] + src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" /> [% IF ctx.hold_suspend_post_capture; @@ -223,7 +223,7 @@ FOR format IN formats %] [% format.label | html %] + alt="[% format.label | html %]" src="[% format.icon %][% ctx.cache_key %]" /> [% END %] diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2 index 510fea2d4a..12f8003d7a 100644 --- a/Open-ILS/src/templates/opac/myopac/lists.tt2 +++ b/Open-ILS/src/templates/opac/myopac/lists.tt2 @@ -55,7 +55,7 @@ onclick="alert('[% bb_publish_text %]')"> [% l('Sharing Help') %] + src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" /> @@ -226,7 +226,7 @@ [% IF bbag.pub == 't'; %] [% l('RSS Feed') %] + src="[% ctx.media_prefix %]/images/small-rss.png[% ctx.cache_key %]"/> [% END %] [% IF bbag.pub == 't'; %] + src="[% ctx.media_prefix %]/images/question-mark.png[% ctx.cache_key %]" /> [% IF count < 1 %] diff --git a/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 index a95ab7cc53..87eda1198f 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs_my_lists.tt2 @@ -34,7 +34,7 @@ [% END %] [% l('List Items Help') %] @@ -54,7 +54,7 @@ [% END %] [% l('List Items Help') %] diff --git a/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 index e98f6dda42..415dcec51f 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 @@ -46,7 +46,7 @@ [% END %] [% l('Search Hits Help') %] diff --git a/Open-ILS/src/templates/opac/parts/advanced/expert.tt2 b/Open-ILS/src/templates/opac/parts/advanced/expert.tt2 index c883336fe8..a424bc4114 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/expert.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/expert.tt2 @@ -24,7 +24,7 @@ - [% l('Remove Search Row') %] diff --git a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 index 5310bb6cdf..59b8c4e5e1 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 @@ -50,7 +50,7 @@ - [% l('Remove row') %] diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 index 0b76d08533..1ac3b67815 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 @@ -37,7 +37,7 @@ - diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2 index 8d7b07d1b9..aa12e39ebe 100644 --- a/Open-ILS/src/templates/opac/parts/base.tt2 +++ b/Open-ILS/src/templates/opac/parts/base.tt2 @@ -9,12 +9,12 @@ [% END %] - - + [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %] - + [% END %] [%- libname = ctx.get_aou(ctx.search_ou).name; @@ -33,7 +33,7 @@ [% FOREACH meta IN ctx.metalinks; meta _ "\n"; END; -%] [% IF want_dojo %] [% END %] diff --git a/Open-ILS/src/templates/opac/parts/bookbag_actions.tt2 b/Open-ILS/src/templates/opac/parts/bookbag_actions.tt2 index 611d1fc960..0b0ee67e26 100644 --- a/Open-ILS/src/templates/opac/parts/bookbag_actions.tt2 +++ b/Open-ILS/src/templates/opac/parts/bookbag_actions.tt2 @@ -38,7 +38,7 @@ %]