Update localization for activities and adventures; change links and placeholders

This commit is contained in:
Sean Morley
2024-11-04 19:25:07 -05:00
parent 7988ba4d68
commit 9ac4a8f4e9
17 changed files with 738 additions and 54 deletions

View File

@@ -4,10 +4,9 @@
import type { Adventure, OpenStreetMapPlace } from '$lib/types';
import { onMount } from 'svelte';
import type { PageData } from './$types';
import EditAdventure from '$lib/components/AdventureModal.svelte';
import { appVersion } from '$lib/config';
import { goto } from '$app/navigation';
import AdventureModal from '$lib/components/AdventureModal.svelte';
import { t } from 'svelte-i18n';
export let data: PageData;
@@ -42,9 +41,7 @@
publicAdventures = data.props.adventures;
if (data.user?.pk != null) {
myAdventures = myAdventures.filter(
(adventure) => adventure.user_id === data.user?.pk ?? -1
);
myAdventures = myAdventures.filter((adventure) => adventure.user_id === data.user?.pk);
} else {
myAdventures = [];
}
@@ -93,14 +90,14 @@
{/if}
{#if myAdventures.length !== 0}
<h2 class="text-center font-bold text-2xl mb-4">AdventureLog Results</h2>
<h2 class="text-center font-bold text-2xl mb-4">{$t('search.adventurelog_results')}</h2>
<div class="flex items-center justify-center mt-2 mb-2">
<div class="join">
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="All"
aria-label={$t('adventures.all')}
id="all"
checked
on:change={() => (property = 'all')}
@@ -109,7 +106,7 @@
class="join-item btn"
type="radio"
name="filter"
aria-label="Name"
aria-label={$t('adventures.name')}
id="name"
on:change={() => (property = 'name')}
/>
@@ -117,7 +114,7 @@
class="join-item btn"
type="radio"
name="filter"
aria-label="Type"
aria-label={$t('transportation.type')}
id="type"
on:change={() => (property = 'type')}
/>
@@ -125,7 +122,7 @@
class="join-item btn"
type="radio"
name="filter"
aria-label="Location"
aria-label={$t('adventures.location')}
id="location"
on:change={() => (property = 'location')}
/>
@@ -133,7 +130,7 @@
class="join-item btn"
type="radio"
name="filter"
aria-label="Description"
aria-label={$t('adventures.description')}
id="description"
on:change={() => (property = 'description')}
/>
@@ -141,17 +138,19 @@
class="join-item btn"
type="radio"
name="filter"
aria-label="Activity Types"
aria-label={$t('adventures.activity_types')}
id="activity_types"
on:change={() => (property = 'activity_types')}
/>
</div>
<button class="btn btn-primary ml-2" type="button" on:click={filterByProperty}>Filter</button>
<button class="btn btn-primary ml-2" type="button" on:click={filterByProperty}
>{$t('adventures.filter')}</button
>
</div>
{/if}
{#if myAdventures.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">My Adventures</h2>
<h2 class="text-center font-bold text-2xl mb-4">{$t('adventures.my_adventures')}</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each myAdventures as adventure}
<AdventureCard
@@ -166,7 +165,7 @@
{/if}
{#if publicAdventures.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">Public Adventures</h2>
<h2 class="text-center font-bold text-2xl mb-4">{$t('search.public_adventures')}</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each publicAdventures as adventure}
<AdventureCard
@@ -183,7 +182,7 @@
<div class="divider"></div>
{/if}
{#if osmResults.length > 0}
<h2 class="text-center font-bold mt-2 text-2xl mb-4">Online Results</h2>
<h2 class="text-center font-bold mt-2 text-2xl mb-4">{$t('search.online_results')}</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each osmResults as result}
<div class="bg-base-300 rounded-lg shadow-md p-4 w-96 mb-2">