PINES OPAC Customization: Updates to Library Info Page
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 10 Dec 2020 22:39:27 +0000 (17:39 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 19 Nov 2022 19:55:20 +0000 (14:55 -0500)
- Add map link
- Re-order and format info

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates-bootstrap/opac/parts/library/core_info.tt2

index 9e48741..220118b 100755 (executable)
@@ -6,14 +6,30 @@
 -%]
 <div class="container">
     <div>
+
+    [%- IF ctx.library.parent_ou; %]
+    <div id="branch-info" style="font-weight:bold;font-size:1.3em;">
+        [% ctx.parent.name | html %]:</a>
+    </div>
+    [%  END; -%]
+
     <h2>[% ctx.library.name | html %]</h2>
 
-    [%-
-        lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url');
-        IF lib_url;
-            '<div id="library-url"><a href="'; lib_url | html; '" property="url">'; l('Library web site'); '</a></div>';
-        END;
-    -%]
+    [%- IF ctx.library.mailing_address; %]
+    <div class="my-3" id="addresses">
+        <div id="mailing" property="location address" typeof="PostalAddress">
+            <h3 property="contactType">[% l('Location') %]</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>, 
+            <span property="addressRegion">[% ctx.mailing_address.state | html %]</span> 
+            <span property="postalCode">[% ctx.mailing_address.post_code | html %]</span><br/>
+            <br />
+            <a href="http://www.google.com/maps/place/[% ctx.mailing_address.street1 | html %]+[% ctx.mailing_address.street2 | html %]+[% ctx.mailing_address.city | html %]+[% ctx.mailing_address.state | html %]+[% ctx.mailing_address.post_code | html %]"><i class="fas fa-map-marker-alt" style="color:#28A745;" aria-hidden="true"></i> Map / Directions</a>    
+        </div>
+    </div>
+    [%- END; %]
 
     [%- IF ctx.hours; %]
         [%- INCLUDE "opac/parts/library/hours.tt2"; %]
     [%- IF (ctx.library.email OR ctx.library.phone); %]
     <div class="my-3">
     <h3 id="contact-info">[% l('Contact information') %]</h3>
+    [%-
+        lib_url = ctx.get_org_setting(ctx.library.id, 'lib.info_url');
+        IF lib_url;
+            '<div id="library-url"><i class="fas fa-globe" style="color:#28A745;" aria-hidden="true"></i> '; l('Library web site: '); '<a href="'; lib_url | html; '" property="url" target="_blank">'; lib_url | html; '</a></div>';
+        END;
+    -%]
     [%- IF ctx.library.email; %]
-        <div>[% l('Email address: ') %]<a href="mailto:[% ctx.library.email | html %]" property="email">[% ctx.library.email | html %]</a></div>
+        <div><i class="fas fa-envelope" style="color:#28A745;" aria-hidden="true"></i> [% 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>
+        <div><i class="fas fa-phone" style="color:#28A745;" aria-hidden="true"></i> [% l('Telephone: ') %]<a href="tel:[% ctx.library.phone | html %]" property="telephone">[% ctx.library.phone | html %]</a></div>
     [% END %]
     </div>
     [% END %]
 
-    [%- IF ctx.library.mailing_address; %]
-    <div class="my-3" 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; %]
-    <div>
-    <h3>[% l('Branch relationship') %]</h3>
-    <div id="branch-info">[% l('Parent library: ') %]
-        <a property="branchOf" href="[% mkurl(opac_root _ '/library/' _ ctx.parent.shortname, {}, 1) %]">[% ctx.parent.name | html %]</a>
-    </div>
-    </div>
-    [%  END; -%]
     </div>
 </div>