Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc
Owen Leonard 953088f816 Bug 27830: (follow-up) Merge DE and FR address formats
Library addresses don't include the use of "Street Type" and "Street
Number." DE and FR address formats differ only in the position of street
type and number in the address sequence.

This patch merges DE and FR address markup and uses the unified block if
the address format system preference ISN'T "us".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-21 10:51:30 +02:00

81 lines
3.4 KiB
PHP

[%~ USE Koha ~%]
[%~ USE raw ~%]
[%~ BLOCK 'display-library-address' ~%]
[%~ SET line_break = "<br/>" ~%]
[%~ IF no_line_break %][% SET line_break = " " %][% END ~%]
[%~ IF Koha.Preference( 'AddressFormat' ) == "us" ~%]
[%~ PROCESS 'display-library-address-us' ~%]
[%~ ELSE ~%]
[%~ PROCESS 'display-library-address-de-fr' ~%]
[%~ 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-fr' ~%]
[%~ IF ( library.branchaddress1 or library.branchaddress2 ) ~%]
<span property="streetAddress">
[%~ 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 ~%]
</span>
[%~ END ~%]
[%~ IF ( library.branchcity ) ~%]
<span 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 %]<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 ~%]