Add photo's city on Photo viewer

This commit is contained in:
2021-11-14 19:52:30 +01:00
parent cf6afd832e
commit b835d0f5f6
2 changed files with 30 additions and 5 deletions

View File

@@ -105,6 +105,7 @@
id
title
}
city
}
}
`)
@@ -198,7 +199,17 @@
<h1 class="title-medium">{currentPhoto.title}</h1>
<div class="detail text-info">
<Icon class="icon" icon="map-pin" label="Map pin" /><span>{location.name}, {location.country.name}</span> <span class="sep">&middot;</span> <time datetime={dayjs(currentPhoto.date_taken).format('YYYY-MM-DD')}>{dayjs(currentPhoto.date_taken).format('MMMM, Do YYYY')}</time>
<a href="/{location.country.slug}/{location.slug}">
<Icon class="icon" icon="map-pin" label="Map pin" />
<span>
{#if currentPhoto.city}
{currentPhoto.city}, {location.name}, {location.country.name}
{:else}
{location.name}, {location.country.name}
{/if}
</span>
</a>
<span class="sep">&middot;</span> <time datetime={dayjs(currentPhoto.date_taken).format('YYYY-MM-DD')}>{dayjs(currentPhoto.date_taken).format('MMMM, Do YYYY')}</time>
</div>
</div>
</div>
@@ -258,12 +269,16 @@
id
title
}
city
}
location (filter: { slug: { _eq: "${page.params.location}" }}) {
name
slug
country { name }
country {
name
slug
}
}
}
`)