1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 14:59:36 +02:00

is visited

This commit is contained in:
Sean Morley 2024-10-31 09:51:04 -04:00
parent 9d42dbac98
commit 727daf0cfd
10 changed files with 284 additions and 281 deletions

View file

@ -16,7 +16,6 @@
import CollectionLink from './CollectionLink.svelte';
import DotsHorizontal from '~icons/mdi/dots-horizontal';
import DeleteWarning from './DeleteWarning.svelte';
import { isAdventureVisited } from '$lib';
import CardCarousel from './CardCarousel.svelte';
import { t } from 'svelte-i18n';
@ -132,7 +131,7 @@
<div>
<div class="badge badge-primary">{$t(`adventures.activities.${adventure.type}`)}</div>
<div class="badge badge-success">
{isAdventureVisited(adventure) ? $t('adventures.visited') : $t('adventures.planned')}
{adventure.is_visited ? $t('adventures.visited') : $t('adventures.planned')}
</div>
<div class="badge badge-secondary">
{adventure.is_public ? $t('adventures.public') : $t('adventures.private')}

View file

@ -28,6 +28,7 @@
import ActivityComplete from './ActivityComplete.svelte';
import { appVersion } from '$lib/config';
import { ADVENTURE_TYPES } from '$lib';
import RegionCard from './RegionCard.svelte';
let wikiError: string = '';
@ -629,7 +630,11 @@ it would also work to just use on:click on the MapLibre component itself. -->
{#if reverseGeocodePlace}
<div class="mt-2">
<p>{reverseGeocodePlace.region}, {reverseGeocodePlace.country}</p>
<p>{reverseGeocodePlace.is_visited ? 'Visited' : 'Not Visited'}</p>
<p>
{reverseGeocodePlace.is_visited
? $t('adventures.visited')
: $t('adventures.not_visited')}
</p>
</div>
{#if !reverseGeocodePlace.is_visited}
<div role="alert" class="alert alert-info mt-2">
@ -647,10 +652,15 @@ it would also work to just use on:click on the MapLibre component itself. -->
></path>
</svg>
<span
>Mark region {reverseGeocodePlace.region}, {reverseGeocodePlace.country} as visited?</span
>{$t('adventures.mark_region_as_visited', {
values: {
region: reverseGeocodePlace.region,
country: reverseGeocodePlace.country
}
})}</span
>
<button type="button" class="btn btn-neutral" on:click={markVisited}>
Mark as Visited
{$t('adventures.mark_visited')}
</button>
</div>
{/if}