From e7537865c2486e643d47d3974eb6e7d519c2c201 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Fri, 19 Aug 2011 16:35:12 -0400 Subject: [PATCH] Disable Google Analytics in T-PAC by default The option to enable Google Analytics has been turned into a config setting in parts/config.tt2 for now, with a place to set the GA account code. Also, get consistent with foo.enabled instead of a mix of foo.enable / foo.enabled in config.tt2. Also, be a bit more careful about whitespace and hide comments in the HTML source about things that are disabled (such as ChiliFresh and Google Analytics) until they are enabled. Signed-off-by: Dan Scott --- Open-ILS/src/templates/default/opac/parts/chilifresh.tt2 | 9 +++------ Open-ILS/src/templates/default/opac/parts/config.tt2 | 11 ++++++++++- Open-ILS/src/templates/default/opac/parts/js.tt2 | 16 +++++++++------- .../src/templates/default/opac/parts/record/summary.tt2 | 6 +++--- .../src/templates/default/opac/parts/result/table.tt2 | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Open-ILS/src/templates/default/opac/parts/chilifresh.tt2 b/Open-ILS/src/templates/default/opac/parts/chilifresh.tt2 index d58b3f5b97..937e20f3f7 100644 --- a/Open-ILS/src/templates/default/opac/parts/chilifresh.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/chilifresh.tt2 @@ -1,13 +1,11 @@ - - - -[% IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT +[%- IF ENV.OILS_CHILIFRESH_URL AND ENV.OILS_CHILIFRESH_ACCOUNT AND (ctx.page == 'rresult' OR 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; %] + - -[% IF ctx.is_staff %] +[%- PROCESS "default/opac/parts/config.tt2"; %] + +[%- IF ctx.is_staff %] -[% END %] +[%- END %] -[% IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record'; +[%- IF ENV.OILS_NOVELIST_URL AND ctx.page == 'record'; url = ENV.OILS_NOVELIST_URL; IF CGI.https; url = url.replace('^http:', 'https:'); END; %] -[% END %] +[%- END %] +[%- IF google_analytics.enabled == 'true' %] - +[%- END %] diff --git a/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 index 4aca69342d..4fed6d024d 100644 --- a/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 @@ -5,9 +5,9 @@ -[% IF ctx.refworks.enable == 'true' %] +[%- IF ctx.refworks.enabled == 'true' %] [% INCLUDE 'default/opac/parts/record/refworks.tt2' %] -[% END %] +[%- END %] @@ -80,7 +80,7 @@ [% attrs.phys_desc | html %] - [% IF openurl.enabled == 'true'; + [%- IF openurl.enabled == 'true'; FOR issn IN args.issns; sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl); FOR res IN sfx; diff --git a/Open-ILS/src/templates/default/opac/parts/result/table.tt2 b/Open-ILS/src/templates/default/opac/parts/result/table.tt2 index 9884045e6b..75751ff4d2 100644 --- a/Open-ILS/src/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/result/table.tt2 @@ -97,7 +97,7 @@ [% attrs.isbns.0 | html %] [% END %] - [% IF openurl.enabled == 'true'; + [%- IF openurl.enabled == 'true'; FOR issn IN args.issns; sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl); FOR res IN sfx; -- 2.11.0