From 6b64de17f4398643fa84569f48341931cf0333ae Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Thu, 23 Sep 2021 12:53:54 -0400 Subject: [PATCH] LP1944755 Add ability to embed carousels on external pages This displays carousels on an otherwise blank page, allowing libraries to very easily embed them on their web sites using iframes. Example iframe code: The base_simple code could also be used by other future features that are driven by Evergreen but that shouldn't display the headers and footers. Signed-off-by: Terran McCanna --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 1 + Open-ILS/src/templates-bootstrap/opac/carousel.tt2 | 8 +++ .../templates-bootstrap/opac/parts/base_simple.tt2 | 84 ++++++++++++++++++++++ .../templates-bootstrap/opac/parts/misc_util.tt2 | 2 +- 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/templates-bootstrap/opac/carousel.tt2 create mode 100644 Open-ILS/src/templates-bootstrap/opac/parts/base_simple.tt2 diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 5515d74dfd..6b5a679dfe 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -173,6 +173,7 @@ sub load { return $self->load_cache_clear if $path =~ m|opac/cache/clear|; return $self->load_temp_warn_post if $path =~ m|opac/temp_warn/post|; return $self->load_temp_warn if $path =~ m|opac/temp_warn|; + return $self->load_simple("carousel") if $path =~ m|opac/carousel|; # ---------------------------------------------------------------- # Everything below here requires SSL diff --git a/Open-ILS/src/templates-bootstrap/opac/carousel.tt2 b/Open-ILS/src/templates-bootstrap/opac/carousel.tt2 new file mode 100644 index 0000000000..bf54466b32 --- /dev/null +++ b/Open-ILS/src/templates-bootstrap/opac/carousel.tt2 @@ -0,0 +1,8 @@ +[%- PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/base_simple.tt2"; + PROCESS "opac/parts/org_selector.tt2"; + ctx.metalinks.push(''); + ctx.page_title = l("Carousel"); + PROCESS carousels; + END +-%] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/base_simple.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/base_simple.tt2 new file mode 100644 index 0000000000..9ac17e4556 --- /dev/null +++ b/Open-ILS/src/templates-bootstrap/opac/parts/base_simple.tt2 @@ -0,0 +1,84 @@ + + + + + + [% IF ctx.refresh %] + + [% ELSIF ctx.authtime AND !ctx.is_staff %] + + [% END %] + + + + + + + + + [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %] + + [% END %] + + [% IF ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css') %] + [% custom_css = ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css') %] + [% '' %] + [% END %] + + [%- libname = ctx.get_aou(ctx.search_ou).name; + libname = libname | html; + libsname = ctx.get_aou(ctx.search_ou).shortname; %] + [%- IF ctx.user_stats.messages.unread; + l('([_1])', ctx.user_stats.messages.unread); + END; + -%] + [% l('[_1] - [_2]', ctx.page_title, libname) %] + + + [%-# Hook for page-specific metadata such as %] + [%- ctx.metalinks.push(''); %] + [%- ctx.metalinks.push(''); %] + [% FOREACH meta IN ctx.metalinks; meta _ "\n"; END; -%] + [% IF want_dojo %] + + [% END %] + + [% IF !ctx.is_staff %] + [% INCLUDE 'opac/parts/goog_analytics.tt2' %] + [% END %] + [% PROCESS 'opac/parts/stripe.tt2' %] + + + + + + +

[% l('Catalog') %]

+ [%#Each content page needs (at minimum) an

describing the content%] +
+ [% content %] +
+ [% INCLUDE 'opac/parts/js.tt2' %] + + [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %] + [%- INCLUDE 'opac/parts/chilifresh.tt2' %] + [%- END %] + + + + + diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 index 5fa8324d5b..854a67dd38 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 @@ -842,7 +842,7 @@
  • -- 2.11.0