Bugzilla – Attachment 119807 Details for
Bug 27830
OPAC library list does not use AddressFormat
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27830: OPAC library list does not use AddressFormat
Bug-27830-OPAC-library-list-does-not-use-AddressFo.patch (text/plain), 9.45 KB, created by
Katrin Fischer
on 2021-04-17 23:36:43 UTC
(
hide
)
Description:
Bug 27830: OPAC library list does not use AddressFormat
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-04-17 23:36:43 UTC
Size:
9.45 KB
patch
obsolete
>From 92bba4ec085fdacff1d141093256f59d8b6b3234 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 4 Mar 2021 13:57:32 +0000 >Subject: [PATCH] Bug 27830: OPAC library list does not use AddressFormat > >This patch adds a new include file for displaying library addresses >according to the AddressFormat system preference. It differs from the >include file used for patrons in the staff interface because library >addresses don't use streetnumber or road types. > >To test, apply the patch and rebuild the OPAC CSS >(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). > >- Make sure you have fill address information entered for at least one > library. >- In the OPAC, view the "Libraries" page. >- Check that the format of the library addresses is correct when using > any of the three address formats: de, fr, and us. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 4 + > .../en/includes/display-library-address.inc | 114 +++++++++++++++++++++ > .../opac-tmpl/bootstrap/en/modules/opac-library.tt | 45 +++----- > 3 files changed, 130 insertions(+), 33 deletions(-) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index e960e87aea..391a10f296 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -2622,4 +2622,8 @@ $star-selected: #EDB867; > } > } > >+.branchaddress { >+ margin-bottom: 1rem; >+} >+ > @import "responsive"; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc >new file mode 100644 >index 0000000000..4b0e39e638 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc >@@ -0,0 +1,114 @@ >+[%~ USE Koha ~%] >+[%~ USE raw ~%] >+[%~ BLOCK 'display-library-address' ~%] >+ [%~ SET line_break = "<br/>" ~%] >+ [%~ IF no_line_break %][% SET line_break = " " %][% END ~%] >+ [%~ IF Koha.Preference( 'AddressFormat' ) ~%] >+ [%~ PROCESS "display-library-address-${ Koha.Preference( 'AddressFormat' ) }" ~%] >+ [%~ ELSE ~%] >+ [%~ PROCESS 'display-library-address-us' ~%] >+ [%~ END ~%] >+[%~ END ~%] >+ >+[%~ BLOCK 'display-library-address-us' ~%] >+ [%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%] >+ <span property="streetAddress"> >+ [%~ IF ( library.branchaddress1 ) ~%] >+ <div class="branchaddress1"> >+ [% library.branchaddress1 | html %] >+ </div> >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress2 ) ~%] >+ <div class="branchaddress2"> >+ [%~ library.branchaddress2 |html ~%] >+ </div> >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress3 ) ~%] >+ <span class="branchaddress3"> >+ [%~ library.branchaddress3 | html ~%] >+ </span> >+ [% line_break | $raw %] >+ [%~ END ~%] >+ </span> >+ [%~ END ~%] >+ [%~ IF ( library.branchcity ) ~%] >+ <div class="branchcity"> >+ <span property="addressLocality"> >+ [%~ library.branchcity |html ~%] >+ </span> >+ [%~ IF ( library.branchstate ) %] >+ <span property="addressRegion"> >+ , [% library.branchstate |html ~%] >+ </span> >+ [%~ END ~%] >+ [%~ IF ( library.branchzip ) %] >+ <span property="postalCode"> >+ [%~ " " _ library.branchzip |html ~%] >+ </span> >+ [%~ END ~%] >+ [%~ IF ( library.branchcountry ) %] >+ <div property="addressCountry"> >+ [% library.branchcountry |html ~%] >+ </div> >+ [%~ END ~%] >+ </div> >+ [%~ END ~%] >+[%~ END ~%] >+ >+[%~ BLOCK 'display-library-address-de' ~%] >+ [%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%] >+ <span property="streetAddress"> >+ [%~ IF ( library.branchaddress1 ) ~%] >+ <div class="branchaddress1"> >+ [%~ library.branchaddress1 | html ~%] >+ </div> >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress2 ) ~%] >+ <div class="branchaddress2"> >+ [%~ library.branchaddress2 | html ~%] >+ </div> >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress3 ) ~%] >+ <span class="branchaddress3"> >+ [%~ library.branchaddress3 | html ~%] >+ </span> >+ [% line_break | $raw %] >+ [%~ END ~%] >+ </span> >+ [%~ END ~%] >+ [%~ IF ( library.branchcity ) ~%] >+ <div class="branchcity"> >+ [%~ IF ( library.branchzip ) ~%]<span property="postalCode">[%~ library.branchzip | html %]</span> [% END ~%]<span property="addressLocality">[%~ library.branchcity | html ~%]</span>[%~ IF ( library.branchstate ) ~%][% line_break | $raw %][%~ library.branchstate | html ~%][%~ END ~%] >+ [%~ IF ( library.branchcountry ) ~%][% line_break | $raw %][%~ library.branchcountry | html ~%][%~ END ~%] >+ </div> >+ [%~ END ~%] >+[%~ END ~%] >+ >+[%~ BLOCK 'display-library-address-fr' ~%] >+ [%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%] >+ [%~ IF ( library.branchaddress1 ) ~%] >+ <span class="branchaddress1"> >+ [%~ library.branchaddress1 | html ~%] >+ </span> >+ [% line_break | $raw %] >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress2 ) ~%] >+ <span class="branchaddress2"> >+ [%~ library.branchaddress2 | html ~%] >+ </span> >+ [% line_break | $raw %] >+ [%~ END ~%] >+ [%~ IF ( library.branchaddress3 ) ~%] >+ <span class="branchaddress3"> >+ [%~ library.branchaddress3 | html ~%] >+ </span> >+ [% line_break | $raw %] >+ [%~ END ~%] >+ [%~ END ~%] >+ [%~ IF ( library.branchcity ) ~%] >+ <span class="branchcity"> >+ [%~ IF ( library.branchzip ) ~%][%~ library.branchzip | html %] [% END ~%][%~ library.branchcity | html ~%][%~ IF ( library.branchstate ) ~%][% line_break | $raw %]<span property="addressRegion">[%~ library.branchstate | html ~%]</span>[%~ END ~%] >+ [%~ IF ( library.branchcountry ) ~%][% line_break | $raw %]<span property="addressCountry">[%~ library.branchcountry | html ~%]</span>[%~ END ~%] >+ </span> >+ [%~ END ~%] >+[%~ END ~%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >index 66f131e61a..2a2506e853 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >+[% PROCESS 'display-library-address.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title> > [% IF ( library ) %] >@@ -28,40 +29,18 @@ > [% END %] > > [% BLOCK library_info %] >- <div property="address" typeof="PostalAddress"> >- <span property="streetAddress"> >- [% IF ( library.branchaddress1 ) %] >- [% library.branchaddress1 | html %] >- [% END %] >- [% IF ( library.branchaddress2 ) %] >- <br />[% library.branchaddress2 | html %] >- [% END %] >- [% IF ( library.branchaddress3 ) %] >- <br />[% library.branchaddress3 | html %] >- [% END %] >- </span><br> >- [% IF ( library.branchcity ) %] >- <span property="addressLocality">[% library.branchcity | html %]</span> >- [% END %] >- [% IF ( library.branchstate ) %] >- <span property="addressRegion">[% library.branchstate | html %]</span> >- [% END %] >- [% IF ( library.branchzip ) %] >- <span property="postalCode">[% library.branchzip | html %]</span> >- [% END %] >- [% IF ( library.branchcountry ) %] >- <br /><span property="addressCountry">[% library.branchcountry | html %]</span> >- [% END %] >- [% IF ( library.branchphone ) %] >- <p>Phone: <a href="tel:[% library.branchphone | url %]" property="telephone">[% library.branchphone | html %]</a></p> >- [% END %] >- [% IF ( library.branchfax ) %] >- <p>Fax: <span property="faxNumber">[% library.branchfax | html %]</span></p> >- [% END %] >- [% IF ( library.branchurl ) %] >- <p><a href="[% library.branchurl | url %]" property="url">[% library.branchurl | html %]</a></p> >- [% END %] >+ <div class="branchaddress" property="address" typeof="PostalAddress"> >+ [% PROCESS 'display-library-address' %] > </div> <!-- /div property=address --> >+ [% IF ( library.branchphone ) %] >+ <p>Phone: <a href="tel:[% library.branchphone | url %]" property="telephone">[% library.branchphone | html %]</a></p> >+ [% END %] >+ [% IF ( library.branchfax ) %] >+ <p>Fax: <span property="faxNumber">[% library.branchfax | html %]</span></p> >+ [% END %] >+ [% IF ( library.branchurl ) %] >+ <p><a href="[% library.branchurl | url %]" property="url">[% library.branchurl | html %]</a></p> >+ [% END %] > [% END %] > > <div class="main"> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27830
:
117731
|
119438
|
119559
| 119807 |
119808