Add email links

This commit is contained in:
2026-03-11 15:22:34 +04:00
parent e01cb2ce6f
commit ffcb8219b0
2 changed files with 22 additions and 0 deletions

View File

@@ -111,6 +111,12 @@ export default class PlaceDetails extends Component {
);
}
if (type === 'email') {
return htmlSafe(
parts.map((p) => `<a href="mailto:${p}">${p}</a>`).join('<br>')
);
}
if (type === 'url') {
return htmlSafe(
parts
@@ -132,6 +138,11 @@ export default class PlaceDetails extends Component {
return this.formatMultiLine(val, 'phone');
}
get email() {
const val = this.tags.email || this.tags['contact:email'];
return this.formatMultiLine(val, 'email');
}
get website() {
const val =
this.place.url || this.tags.website || this.tags['contact:website'];
@@ -301,6 +312,15 @@ export default class PlaceDetails extends Component {
</p>
{{/if}}
{{#if this.email}}
<p class="content-with-icon">
<Icon @name="mail" @title="Email" />
<span>
{{this.email}}
</span>
</p>
{{/if}}
{{#if this.facebook}}
<p class="content-with-icon">
<Icon @name="facebook" @title="Facebook" />