Begin enabling KPAC-branded library info page
authorDan Scott <dscott@laurentian.ca>
Thu, 23 Jan 2014 16:41:52 +0000 (11:41 -0500)
committerDan Scott <dscott@laurentian.ca>
Sat, 25 Jan 2014 14:20:05 +0000 (09:20 -0500)
This needs work and is going to get squashed like a bug when we're through.

Yeesh.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm
Open-ILS/src/templates/kpac/library.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/library.tt2
Open-ILS/src/templates/opac/parts/library/core_info.tt2 [new file with mode: 0644]

index 77a7eae..30fbca2 100644 (file)
@@ -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 (file)
index 0000000..2c1dc65
--- /dev/null
@@ -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; %]
index 24a4f7a..f733ca0 100644 (file)
@@ -4,54 +4,5 @@
     ctx.page_title = l("Library details: [_1]", ctx.library.name);
 -%]
     [%- INCLUDE "opac/parts/searchbar.tt2" %]
-<div id="content-wrapper">
-    <div id="main-content" class="content-wrapper-library-page" vocab="http://schema.org/" typeof="Library">
-    <h1 property="name">[% ctx.library.name | html %]</h1>
-
-    [%-
-        lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url');
-        IF lib_url;
-            '<div id="library-url"><a href="'; lib_url | url; '" property="url">'; l('Library web site'); '</a></div>';
-        END;
-    -%]
-
-    [%- IF ctx.hours; %]
-        [%- INCLUDE "opac/parts/library/hours.tt2"; %]
-    [% END; -%]
-
-    [%- IF (ctx.library.email OR ctx.library.phone); %]
-    <h2 id="contact-info">[% l('Contact information') %]</h2>
-    [%- IF ctx.library.email; %]
-        <div>[% l('Email address: ') %]<a href="mailto:[% ctx.library.email | html %]" property="email">[% ctx.library.email | html %]</a></div>
-    [%- END; %]
-    [%- IF ctx.library.phone; %]
-        <div>[% l('Telephone: ') %]<a href="tel:[% ctx.library.phone | html %]" property="telephone">[% ctx.library.phone | html %]</a></div>
-    [% END; %]
-    [% END; %]
-
-    [%- IF ctx.library.mailing_address; %]
-    <div id="addresses">
-        <div id="mailing" property="location address" typeof="PostalAddress">
-            <h3 property="contactType">[% l('Mailing address') %]</h3>
-            <span property="streetAddress">[% ctx.mailing_address.street1 | html %]
-            [%- IF ctx.mailing_address.street2; "<br />"; ctx.mailing_address.street2 | html; END; %]
-            </span><br />
-            <span property="addressLocality">[% ctx.mailing_address.city | html %]</span><br />
-            <span property="addressRegion">[% ctx.mailing_address.state | html %]</span><br />
-            <span property="addressCountry">[% ctx.mailing_address.country | html %]</span><br />
-            <span property="postalCode">[% ctx.mailing_address.post_code | html %]</span><br />
-        </div>
-    </div>
-    [%- END; %]
-
-    [%- IF ctx.library.parent_ou; %]
-    <h2>Branch relationship</h2>
-    <div id="branch-info">[% l('Parent library: ') %]
-        <a property="branchOf" href="[% mkurl(ctx.opac_root _ '/library/' _ ctx.parent.shortname, {}, 1) %]">[% ctx.parent.name | html %]</a>
-    </div>
-    [%  END; -%]
-
-    <div class="common-full-pad"></div>
-    </div>
-[%- END %]
-</div>
+    [%- 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 (file)
index 0000000..b48c0d7
--- /dev/null
@@ -0,0 +1,50 @@
+<div id="content-wrapper">
+    <div id="main-content" class="content-wrapper-library-page" vocab="http://schema.org/" typeof="Library">
+    <h1 property="name">[% ctx.library.name | html %]</h1>
+
+    [%-
+        lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url');
+        IF lib_url;
+            '<div id="library-url"><a href="'; lib_url | url; '" property="url">'; l('Library web site'); '</a></div>';
+        END;
+    -%]
+
+    [%- IF ctx.hours; %]
+        [%- INCLUDE "opac/parts/library/hours.tt2"; %]
+    [% END; -%]
+
+    [%- IF (ctx.library.email OR ctx.library.phone); %]
+    <h2 id="contact-info">[% l('Contact information') %]</h2>
+    [%- IF ctx.library.email; %]
+        <div>[% l('Email address: ') %]<a href="mailto:[% ctx.library.email | html %]" property="email">[% ctx.library.email | html %]</a></div>
+    [%- END; %]
+    [%- IF ctx.library.phone; %]
+        <div>[% l('Telephone: ') %]<a href="tel:[% ctx.library.phone | html %]" property="telephone">[% ctx.library.phone | html %]</a></div>
+    [% END; %]
+    [% END; %]
+
+    [%- IF ctx.library.mailing_address; %]
+    <div id="addresses">
+        <div id="mailing" property="location address" typeof="PostalAddress">
+            <h3 property="contactType">[% l('Mailing address') %]</h3>
+            <span property="streetAddress">[% ctx.mailing_address.street1 | html %]
+            [%- IF ctx.mailing_address.street2; "<br />"; ctx.mailing_address.street2 | html; END; %]
+            </span><br />
+            <span property="addressLocality">[% ctx.mailing_address.city | html %]</span><br />
+            <span property="addressRegion">[% ctx.mailing_address.state | html %]</span><br />
+            <span property="addressCountry">[% ctx.mailing_address.country | html %]</span><br />
+            <span property="postalCode">[% ctx.mailing_address.post_code | html %]</span><br />
+        </div>
+    </div>
+    [%- END; %]
+
+    [%- IF ctx.library.parent_ou; %]
+    <h2>Branch relationship</h2>
+    <div id="branch-info">[% l('Parent library: ') %]
+        <a property="branchOf" href="[% mkurl(ctx.opac_root _ '/library/' _ ctx.parent.shortname, {}, 1) %]">[% ctx.parent.name | html %]</a>
+    </div>
+    [%  END; -%]
+
+    <div class="common-full-pad"></div>
+    </div>
+</div>