Show message when no photos are available on Location
This commit is contained in:
@@ -145,56 +145,65 @@
|
||||
<div class="location-page__illustration" />
|
||||
</section>
|
||||
|
||||
<section class="location-page__houses grid">
|
||||
{#each photos as { title, image: { id, title: alt }, slug, date_taken }, index}
|
||||
<div class="house grid">
|
||||
<div class="house__info">
|
||||
<a href="/{params.country}/{params.location}/{slug}">
|
||||
<h2 class="title-image">
|
||||
{title}
|
||||
</h2>
|
||||
<time class="text-date" datetime={dayjs(date_taken).format('YYYY-MM-DD')}>
|
||||
{dayjs(date_taken).format('MMMM, Do YYYY')}
|
||||
</time>
|
||||
{#if photos.length}
|
||||
<section class="location-page__houses grid">
|
||||
{#each photos as { title, image: { id, title: alt }, slug, date_taken }, index}
|
||||
<div class="house grid">
|
||||
<div class="house__info">
|
||||
<a href="/{params.country}/{params.location}/{slug}">
|
||||
<h2 class="title-image">
|
||||
{title}
|
||||
</h2>
|
||||
<time class="text-date" datetime={dayjs(date_taken).format('YYYY-MM-DD')}>
|
||||
{dayjs(date_taken).format('MMMM, Do YYYY')}
|
||||
</time>
|
||||
</a>
|
||||
</div>
|
||||
<a class="house__photo" href="/{params.country}/{params.location}/{slug}">
|
||||
<Image
|
||||
id={id}
|
||||
alt="{alt}"
|
||||
width={1280}
|
||||
height={853}
|
||||
class="shadow-photo"
|
||||
/>
|
||||
<span class="house__index title-index">
|
||||
{(totalPhotos - index < 10) ? '0' : ''}{totalPhotos - index}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<a class="house__photo" href="/{params.country}/{params.location}/{slug}">
|
||||
<Image
|
||||
id={id}
|
||||
alt="{alt}"
|
||||
width={1280}
|
||||
height={853}
|
||||
class="shadow-photo"
|
||||
/>
|
||||
<span class="house__index title-index">
|
||||
{(totalPhotos - index < 10) ? '0' : ''}{totalPhotos - index}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
{/each}
|
||||
</section>
|
||||
{/each}
|
||||
</section>
|
||||
|
||||
<section class="location-page__next">
|
||||
<div class="container">
|
||||
<div class="pagination" role="button" on:click={!ended && loadMorePhotos} disabled={ended ? ended : undefined}>
|
||||
<div class="pagination__progress">
|
||||
<span class="current">{currentPhotosAmount}</span>
|
||||
<span>/</span>
|
||||
<span class="total">{totalPhotos}</span>
|
||||
<section class="location-page__next">
|
||||
<div class="container">
|
||||
<div class="pagination" role="button" on:click={!ended && loadMorePhotos} disabled={ended ? ended : undefined}>
|
||||
<div class="pagination__progress">
|
||||
<span class="current">{currentPhotosAmount}</span>
|
||||
<span>/</span>
|
||||
<span class="total">{totalPhotos}</span>
|
||||
|
||||
{#if !ended}
|
||||
<p class="pagination__more">See more photos</p>
|
||||
{:else}
|
||||
<p class="pagination__message">You've seen it all!</p>
|
||||
{/if}
|
||||
{#if !ended}
|
||||
<p class="pagination__more">See more photos</p>
|
||||
{:else}
|
||||
<p class="pagination__message">You've seen it all!</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if ended}
|
||||
<Newsletter theme="light" />
|
||||
{/if}
|
||||
{#if ended}
|
||||
<Newsletter theme="light" />
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
{:else}
|
||||
<div class="location-page__message">
|
||||
<p>
|
||||
No photos available for {data.name}.<br>
|
||||
Come back later!
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user