From a49b91ff2afbffe4dc09dfd2df02893c4733d8ca Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 23 Jan 2014 11:41:52 -0500 Subject: [PATCH] Begin enabling KPAC-branded library info page This needs work and is going to get squashed like a bug when we're through. Yeesh. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- .../src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm | 1 + Open-ILS/src/templates/kpac/library.tt2 | 6 +++ Open-ILS/src/templates/opac/library.tt2 | 53 +--------------------- .../src/templates/opac/parts/library/core_info.tt2 | 50 ++++++++++++++++++++ 4 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 Open-ILS/src/templates/kpac/library.tt2 create mode 100644 Open-ILS/src/templates/opac/parts/library/core_info.tt2 diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 77a7eae6a1..30fbca261d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -29,6 +29,7 @@ sub load { return $self->load_simple("category") if $path =~ m|kpac/category|; return $self->load_kpac_rresults if $path =~ m|kpac/results|; return $self->load_record(no_search => 1) if $path =~ m|kpac/record|; + return $self->load_library if $path =~ m|kpac/library|; # ---------------------------------------------------------------- # Everything below here requires SSL diff --git a/Open-ILS/src/templates/kpac/library.tt2 b/Open-ILS/src/templates/kpac/library.tt2 new file mode 100644 index 0000000000..2c1dc650b3 --- /dev/null +++ b/Open-ILS/src/templates/kpac/library.tt2 @@ -0,0 +1,6 @@ +[%- PROCESS "opac/parts/header.tt2"; + WRAPPER "kpac/parts/subpage.tt2"; + ctx.page_title = l("Library details: [_1]", ctx.library.name); +-%] + [%- INCLUDE "opac/parts/library/core_info.tt2"; %] +[%- END; %] diff --git a/Open-ILS/src/templates/opac/library.tt2 b/Open-ILS/src/templates/opac/library.tt2 index 24a4f7a91c..f733ca0b0c 100644 --- a/Open-ILS/src/templates/opac/library.tt2 +++ b/Open-ILS/src/templates/opac/library.tt2 @@ -4,54 +4,5 @@ ctx.page_title = l("Library details: [_1]", ctx.library.name); -%] [%- INCLUDE "opac/parts/searchbar.tt2" %] -
-
-

[% ctx.library.name | html %]

- - [%- - lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url'); - IF lib_url; - ''; - END; - -%] - - [%- IF ctx.hours; %] - [%- INCLUDE "opac/parts/library/hours.tt2"; %] - [% END; -%] - - [%- IF (ctx.library.email OR ctx.library.phone); %] -

[% l('Contact information') %]

- [%- IF ctx.library.email; %] -
[% l('Email address: ') %][% ctx.library.email | html %]
- [%- END; %] - [%- IF ctx.library.phone; %] -
[% l('Telephone: ') %][% ctx.library.phone | html %]
- [% END; %] - [% END; %] - - [%- IF ctx.library.mailing_address; %] -
-
-

[% l('Mailing address') %]

- [% ctx.mailing_address.street1 | html %] - [%- IF ctx.mailing_address.street2; "
"; ctx.mailing_address.street2 | html; END; %] -

- [% ctx.mailing_address.city | html %]
- [% ctx.mailing_address.state | html %]
- [% ctx.mailing_address.country | html %]
- [% ctx.mailing_address.post_code | html %]
-
-
- [%- END; %] - - [%- IF ctx.library.parent_ou; %] -

Branch relationship

-
[% l('Parent library: ') %] - [% ctx.parent.name | html %] -
- [% END; -%] - -
-
-[%- END %] -
+ [%- INCLUDE "opac/parts/library/core_info.tt2"; %] +[%- END; %] diff --git a/Open-ILS/src/templates/opac/parts/library/core_info.tt2 b/Open-ILS/src/templates/opac/parts/library/core_info.tt2 new file mode 100644 index 0000000000..b48c0d7428 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/library/core_info.tt2 @@ -0,0 +1,50 @@ +
+
+

[% ctx.library.name | html %]

+ + [%- + lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url'); + IF lib_url; + ''; + END; + -%] + + [%- IF ctx.hours; %] + [%- INCLUDE "opac/parts/library/hours.tt2"; %] + [% END; -%] + + [%- IF (ctx.library.email OR ctx.library.phone); %] +

[% l('Contact information') %]

+ [%- IF ctx.library.email; %] +
[% l('Email address: ') %][% ctx.library.email | html %]
+ [%- END; %] + [%- IF ctx.library.phone; %] +
[% l('Telephone: ') %][% ctx.library.phone | html %]
+ [% END; %] + [% END; %] + + [%- IF ctx.library.mailing_address; %] +
+
+

[% l('Mailing address') %]

+ [% ctx.mailing_address.street1 | html %] + [%- IF ctx.mailing_address.street2; "
"; ctx.mailing_address.street2 | html; END; %] +

+ [% ctx.mailing_address.city | html %]
+ [% ctx.mailing_address.state | html %]
+ [% ctx.mailing_address.country | html %]
+ [% ctx.mailing_address.post_code | html %]
+
+
+ [%- END; %] + + [%- IF ctx.library.parent_ou; %] +

Branch relationship

+
[% l('Parent library: ') %] + [% ctx.parent.name | html %] +
+ [% END; -%] + +
+
+
-- 2.11.0