@@ -, +, @@ - 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. --- 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 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2622,4 +2622,8 @@ $star-selected: #EDB867; } } +.branchaddress { + margin-bottom: 1rem; +} + @import "responsive"; --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc +++ a/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 = "
" ~%] + [%~ 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 ) ~%] + + [%~ IF ( library.branchaddress1 ) ~%] +
+ [% library.branchaddress1 | html %] +
+ [%~ END ~%] + [%~ IF ( library.branchaddress2 ) ~%] +
+ [%~ library.branchaddress2 |html ~%] +
+ [%~ END ~%] + [%~ IF ( library.branchaddress3 ) ~%] + + [%~ library.branchaddress3 | html ~%] + + [% line_break | $raw %] + [%~ END ~%] +
+ [%~ END ~%] + [%~ IF ( library.branchcity ) ~%] +
+ + [%~ library.branchcity |html ~%] + + [%~ IF ( library.branchstate ) %] + + , [% library.branchstate |html ~%] + + [%~ END ~%] + [%~ IF ( library.branchzip ) %] + + [%~ " " _ library.branchzip |html ~%] + + [%~ END ~%] + [%~ IF ( library.branchcountry ) %] +
+ [% library.branchcountry |html ~%] +
+ [%~ END ~%] +
+ [%~ END ~%] +[%~ END ~%] + +[%~ BLOCK 'display-library-address-de' ~%] + [%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%] + + [%~ IF ( library.branchaddress1 ) ~%] +
+ [%~ library.branchaddress1 | html ~%] +
+ [%~ END ~%] + [%~ IF ( library.branchaddress2 ) ~%] +
+ [%~ library.branchaddress2 | html ~%] +
+ [%~ END ~%] + [%~ IF ( library.branchaddress3 ) ~%] + + [%~ library.branchaddress3 | html ~%] + + [% line_break | $raw %] + [%~ END ~%] +
+ [%~ END ~%] + [%~ IF ( library.branchcity ) ~%] +
+ [%~ IF ( library.branchzip ) ~%][%~ library.branchzip | html %] [% END ~%][%~ library.branchcity | html ~%][%~ IF ( library.branchstate ) ~%][% line_break | $raw %][%~ library.branchstate | html ~%][%~ END ~%] + [%~ IF ( library.branchcountry ) ~%][% line_break | $raw %][%~ library.branchcountry | html ~%][%~ END ~%] +
+ [%~ END ~%] +[%~ END ~%] + +[%~ BLOCK 'display-library-address-fr' ~%] + [%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%] + [%~ IF ( library.branchaddress1 ) ~%] + + [%~ library.branchaddress1 | html ~%] + + [% line_break | $raw %] + [%~ END ~%] + [%~ IF ( library.branchaddress2 ) ~%] + + [%~ library.branchaddress2 | html ~%] + + [% line_break | $raw %] + [%~ END ~%] + [%~ IF ( library.branchaddress3 ) ~%] + + [%~ library.branchaddress3 | html ~%] + + [% line_break | $raw %] + [%~ END ~%] + [%~ END ~%] + [%~ IF ( library.branchcity ) ~%] + + [%~ IF ( library.branchzip ) ~%][%~ library.branchzip | html %] [% END ~%][%~ library.branchcity | html ~%][%~ IF ( library.branchstate ) ~%][% line_break | $raw %][%~ library.branchstate | html ~%][%~ END ~%] + [%~ IF ( library.branchcountry ) ~%][% line_break | $raw %][%~ library.branchcountry | html ~%][%~ END ~%] + + [%~ END ~%] +[%~ END ~%] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-library.tt +++ a/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' %] [% 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"> --