Merge pull request #9169 from MrPetovan/bug/9163-double-location

Prevent double location display in vcard
This commit is contained in:
Michael Vogel 2020-09-09 07:48:33 +02:00 committed by GitHub
commit b922d7ae28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 63 deletions

View file

@ -354,13 +354,7 @@ class Profile
// Fetch the account type // Fetch the account type
$account_type = Contact::getAccountType($profile); $account_type = Contact::getAccountType($profile);
if (!empty($profile['address']) if (!empty($profile['address']) || !empty($profile['location'])) {
|| !empty($profile['location'])
|| !empty($profile['locality'])
|| !empty($profile['region'])
|| !empty($profile['postal-code'])
|| !empty($profile['country-name'])
) {
$location = DI::l10n()->t('Location:'); $location = DI::l10n()->t('Location:');
} }
@ -427,10 +421,6 @@ class Profile
$p['about'] = BBCode::convert($p['about']); $p['about'] = BBCode::convert($p['about']);
} }
if (empty($p['address']) && !empty($p['location'])) {
$p['address'] = $p['location'];
}
if (isset($p['address'])) { if (isset($p['address'])) {
$p['address'] = BBCode::convert($p['address']); $p['address'] = BBCode::convert($p['address']);
} }

View file

@ -13,16 +13,12 @@
{{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}} {{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}}
{{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}} {{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}}
{{if $location}} {{if $location}}
<dl class="location"><dt class="location-label">{{$location}}</dt> <dl class="location">
<dd class="adr h-adr"> <dt class="location-label">{{$location}}</dt>
{{if $profile.address}}<div class="street-address p-street-address">{{$profile.address nofilter}}</div>{{/if}} <dd class="adr h-adr">
<span class="city-state-zip"> {{if $profile.address}}<p class="street-address p-street-address">{{$profile.address nofilter}}</p>{{/if}}
<span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} {{if $profile.location}}<p class="p-location">{{$profile.location}}</p>{{/if}}
<span class="region p-region">{{$profile.region}}</span> </dd>
<span class="postal-code p-postal-code">{{$profile.postal_code}}</span>
</span>
{{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}}
</dd>
</dl> </dl>
{{/if}} {{/if}}

View file

@ -12,16 +12,12 @@
{{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}} {{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}}
{{if $location}} {{if $location}}
<dl class="location"><dt class="location-label">{{$location}}</dt> <dl class="location">
<dd class="adr h-adr"> <dt class="location-label">{{$location}}</dt>
{{if $profile.address}}<div class="street-address p-street-address">{{$profile.address nofilter}}</div>{{/if}} <dd class="adr h-adr">
<span class="city-state-zip"> {{if $profile.address}}<p class="street-address p-street-address">{{$profile.address nofilter}}</p>{{/if}}
<span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} {{if $profile.location}}<p class="p-location">{{$profile.location}}</p>{{/if}}
<span class="region p-region">{{$profile.region}}</span> </dd>
<span class="postal-code p-postal-code">{{$profile.postal_code}}</span>
</span>
{{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}}
</dd>
</dl> </dl>
{{/if}} {{/if}}

View file

@ -80,13 +80,8 @@
<div class="location detail"> <div class="location detail">
<span class="location-label icon"><i class="fa fa-map-marker"></i></span> <span class="location-label icon"><i class="fa fa-map-marker"></i></span>
<span class="adr"> <span class="adr">
{{if $profile.address}}<span class="street-address p-street-address">{{$profile.address nofilter}}</span>{{/if}} {{if $profile.address}}<p class="street-address p-street-address">{{$profile.address nofilter}}</p>{{/if}}
<span class="city-state-zip"> {{if $profile.location}}<p class="p-location">{{$profile.location}}</p>{{/if}}
<span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}}
<span class="region p-region">{{$profile.region}}</span>
<span class="postal-code p-postal-code">{{$profile.postal_code}}</span>
</span>
{{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}}
</span> </span>
</div> </div>
{{/if}} {{/if}}

View file

@ -24,16 +24,12 @@
{{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}} {{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}}
{{if $location}} {{if $location}}
<dl class="location"><dt class="location-label">{{$location}}</dt> <dl class="location">
<dd class="adr h-adr"> <dt class="location-label">{{$location}}</dt>
{{if $profile.address}}<div class="street-address p-street-address">{{$profile.address nofilter}}</div>{{/if}} <dd class="adr h-adr">
<span class="city-state-zip"> {{if $profile.address}}<p class="street-address p-street-address">{{$profile.address nofilter}}</p>{{/if}}
<span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} {{if $profile.location}}<p class="p-location">{{$profile.location}}</p>{{/if}}
<span class="region p-region">{{$profile.region}}</span> </dd>
<span class="postal-code p-postal-code">{{$profile.postal_code}}</span>
</span>
{{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}}
</dd>
</dl> </dl>
{{/if}} {{/if}}

View file

@ -4500,11 +4500,6 @@ hr.line-dots {
#page-footer {} #page-footer {}
#live-profile {} #live-profile {}
.city-state-zip {}
.country-name {}
.locality {}
.region {}
.postal-code {}
.mpfriend {} .mpfriend {}
.toplevel_item {} .toplevel_item {}

View file

@ -20,16 +20,12 @@
{{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}} {{if $account_type}}<div class="account-type">{{$account_type}}</div>{{/if}}
{{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}} {{if $profile.network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$profile.network_link nofilter}}</dd></dl>{{/if}}
{{if $location}} {{if $location}}
<dl class="location"><dt class="location-label">{{$location}}</dt> <dl class="location">
<dd class="adr h-adr"> <dt class="location-label">{{$location}}</dt>
{{if $profile.address}}<div class="street-address p-street-address">{{$profile.address nofilter}}</div>{{/if}} <dd class="adr h-adr">
<span class="city-state-zip"> {{if $profile.address}}<p class="street-address p-street-address">{{$profile.address nofilter}}</p>{{/if}}
<span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} {{if $profile.location}}<p class="p-location">{{$profile.location}}</p>{{/if}}
<span class="region p-region">{{$profile.region}}</span> </dd>
<span class="postal-code p-postal-code">{{$profile.postal_code}}</span>
</span>
{{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}}
</dd>
</dl> </dl>
{{/if}} {{/if}}