Place: Conditions if undefined latest photo and no illustration

This commit is contained in:
2020-03-11 19:14:30 +01:00
parent 761bfa7486
commit 6c5f4f41e1

View File

@@ -56,7 +56,7 @@
// Define dates // Define dates
$: latestPhoto = photos[0] $: latestPhoto = photos[0]
$: latestPhotoModified = latestPhoto.modified_on.replace(' ', 'T') $: latestPhotoModified = latestPhoto ? latestPhoto.modified_on.replace(' ', 'T') : ''
$: dateUpdatedFull = latestPhoto ? formatDate(latestPhotoModified, 'FULL') : '' $: dateUpdatedFull = latestPhoto ? formatDate(latestPhotoModified, 'FULL') : ''
$: dateUpdatedDatetime = latestPhoto ? formatDate(latestPhotoModified, 'DATETIME') : '' $: dateUpdatedDatetime = latestPhoto ? formatDate(latestPhotoModified, 'DATETIME') : ''
$: dateUpdatedRelative = latestPhoto ? relativeTime(latestPhotoModified, 2592000000) : '' $: dateUpdatedRelative = latestPhoto ? relativeTime(latestPhotoModified, 2592000000) : ''
@@ -150,9 +150,11 @@
</div> </div>
</div> </div>
{#if location.illustration_desktop && location.illustration_mobile}
<div class="place__illustration" <div class="place__illustration"
style="--url-desktop: url({location.illustration_desktop.full_url}); --url-mobile: url({location.illustration_mobile.full_url});" style="--url-desktop: url({location.illustration_desktop.full_url}); --url-mobile: url({location.illustration_mobile.full_url});"
/> />
{/if}
</section> </section>
<section class="photos photos--{layoutSetting || 'list'}"> <section class="photos photos--{layoutSetting || 'list'}">