mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 14:59:36 +02:00
more localization
This commit is contained in:
parent
91c0ec8c07
commit
8068fe93f7
8 changed files with 265 additions and 166 deletions
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { ADVENTURE_TYPES } from '$lib';
|
||||
import { onMount } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
let types_arr: string[] = [];
|
||||
export let types: string;
|
||||
|
@ -29,9 +30,13 @@
|
|||
|
||||
<div class="collapse collapse-plus mb-4">
|
||||
<input type="checkbox" />
|
||||
<div class="collapse-title text-xl bg-base-300 font-medium">Category Filter</div>
|
||||
<div class="collapse-title text-xl bg-base-300 font-medium">
|
||||
{$t('adventures.category_filter')}
|
||||
</div>
|
||||
<div class="collapse-content bg-base-300">
|
||||
<button class="btn btn-wide btn-neutral-300" on:click={clearTypes}>Clear</button>
|
||||
<button class="btn btn-wide btn-neutral-300" on:click={clearTypes}
|
||||
>{$t(`adventures.clear`)}</button
|
||||
>
|
||||
{#each ADVENTURE_TYPES as type}
|
||||
<li>
|
||||
<label class="cursor-pointer">
|
||||
|
@ -41,7 +46,7 @@
|
|||
on:change={() => toggleSelect(type.type)}
|
||||
checked={types.indexOf(type.type) > -1}
|
||||
/>
|
||||
<span>{type.label}</span>
|
||||
<span>{$t(`adventures.activities.${type.type}`)}</span>
|
||||
</label>
|
||||
</li>
|
||||
{/each}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
import Launch from '~icons/mdi/launch';
|
||||
import TrashCanOutline from '~icons/mdi/trash-can-outline';
|
||||
|
||||
import FileDocumentEdit from '~icons/mdi/file-document-edit';
|
||||
import ArchiveArrowDown from '~icons/mdi/archive-arrow-down';
|
||||
|
@ -11,6 +10,7 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import type { Adventure, Collection } from '$lib/types';
|
||||
import { addToast } from '$lib/toasts';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
import Plus from '~icons/mdi/plus';
|
||||
import DotsHorizontal from '~icons/mdi/dots-horizontal';
|
||||
|
@ -39,8 +39,11 @@
|
|||
body: JSON.stringify({ is_archived: is_archived })
|
||||
});
|
||||
if (res.ok) {
|
||||
console.log(`Collection ${is_archived ? 'archived' : 'unarchived'}`);
|
||||
addToast('info', `Collection ${is_archived ? 'archived' : 'unarchived'} successfully!`);
|
||||
if (is_archived) {
|
||||
addToast('info', $t('adventures.archived_collection_message'));
|
||||
} else {
|
||||
addToast('info', $t('adventures.unarchived_collection_message'));
|
||||
}
|
||||
dispatch('delete', collection.id);
|
||||
} else {
|
||||
console.log('Error archiving collection');
|
||||
|
@ -57,8 +60,7 @@
|
|||
}
|
||||
});
|
||||
if (res.ok) {
|
||||
console.log('Collection deleted');
|
||||
addToast('info', 'Collection deleted successfully!');
|
||||
addToast('info', $t('adventures.delete_collection_success'));
|
||||
dispatch('delete', collection.id);
|
||||
} else {
|
||||
console.log('Error deleting collection');
|
||||
|
@ -70,9 +72,9 @@
|
|||
|
||||
{#if isWarningModalOpen}
|
||||
<DeleteWarning
|
||||
title="Delete Collection"
|
||||
button_text="Delete"
|
||||
description="Are you sure you want to delete this collection? This will also delete all of the linked adventures. This action cannot be undone."
|
||||
title={$t('adventures.delete_collection')}
|
||||
button_text={$t('adventures.delete')}
|
||||
description={$t('adventures.delete_collection_warning')}
|
||||
is_warning={true}
|
||||
on:close={() => (isWarningModalOpen = false)}
|
||||
on:confirm={deleteCollection}
|
||||
|
@ -97,12 +99,14 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="inline-flex gap-2 mb-2">
|
||||
<div class="badge badge-secondary">{collection.is_public ? 'Public' : 'Private'}</div>
|
||||
<div class="badge badge-secondary">
|
||||
{collection.is_public ? $t('adventures.public') : $t('adventures.private')}
|
||||
</div>
|
||||
{#if collection.is_archived}
|
||||
<div class="badge badge-warning">Archived</div>
|
||||
<div class="badge badge-warning">{$t('adventures.archived')}</div>
|
||||
{/if}
|
||||
</div>
|
||||
<p>{collection.adventures.length} Adventures</p>
|
||||
<p>{collection.adventures.length} {$t('navbar.adventures')}</p>
|
||||
{#if collection.start_date && collection.end_date}
|
||||
<p>
|
||||
Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} -
|
||||
|
@ -136,23 +140,23 @@
|
|||
<button
|
||||
class="btn btn-neutral mb-2"
|
||||
on:click={() => goto(`/collections/${collection.id}`)}
|
||||
><Launch class="w-5 h-5 mr-1" />Open Details</button
|
||||
><Launch class="w-5 h-5 mr-1" />{$t('adventures.open_details')}</button
|
||||
>
|
||||
{#if !collection.is_archived}
|
||||
<button class="btn btn-neutral mb-2" on:click={editAdventure}>
|
||||
<FileDocumentEdit class="w-6 h-6" />Edit Collection
|
||||
<FileDocumentEdit class="w-6 h-6" />{$t('adventures.edit_collection')}
|
||||
</button>
|
||||
<button class="btn btn-neutral mb-2" on:click={() => (isShareModalOpen = true)}>
|
||||
<FileDocumentEdit class="w-6 h-6" />Share
|
||||
<FileDocumentEdit class="w-6 h-6" />{$t('adventures.share')}
|
||||
</button>
|
||||
{/if}
|
||||
{#if collection.is_archived}
|
||||
<button class="btn btn-neutral mb-2" on:click={() => archiveCollection(false)}>
|
||||
<ArchiveArrowUp class="w-6 h-6 mr-1" />Unarchive
|
||||
<ArchiveArrowUp class="w-6 h-6 mr-1" />{$t('adventures.unarchive')}
|
||||
</button>
|
||||
{:else}
|
||||
<button class="btn btn-neutral mb-2" on:click={() => archiveCollection(true)}>
|
||||
<ArchiveArrowDown class="w-6 h-6 mr" />Archive
|
||||
<ArchiveArrowDown class="w-6 h-6 mr" />{$t('adventures.archive')}
|
||||
</button>
|
||||
{/if}
|
||||
<button
|
||||
|
@ -160,14 +164,14 @@
|
|||
data-umami-event="Delete Adventure"
|
||||
class="btn btn-warning"
|
||||
on:click={() => (isWarningModalOpen = true)}
|
||||
><TrashCan class="w-6 h-6" />Delete</button
|
||||
><TrashCan class="w-6 h-6" />{$t('adventures.delete')}</button
|
||||
>
|
||||
{/if}
|
||||
{#if type == 'viewonly'}
|
||||
<button
|
||||
class="btn btn-neutral mb-2"
|
||||
on:click={() => goto(`/collections/${collection.id}`)}
|
||||
><Launch class="w-5 h-5 mr-1" />Open Details</button
|
||||
><Launch class="w-5 h-5 mr-1" />{$t('adventures.open_details')}</button
|
||||
>
|
||||
{/if}
|
||||
</ul>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { createEventDispatcher } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
import { onMount } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
let modal: HTMLDialogElement;
|
||||
|
||||
export let title: string;
|
||||
|
@ -41,6 +42,6 @@
|
|||
<button class="btn btn-{is_warning ? 'warning' : 'primary'} mr-2" on:click={confirm}
|
||||
>{button_text}</button
|
||||
>
|
||||
<button class="btn btn-neutral" on:click={close}>Cancel</button>
|
||||
<button class="btn btn-neutral" on:click={close}>{$t('adventures.cancel')}</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
|
|
@ -66,6 +66,50 @@
|
|||
"remove_from_collection": "Remove from Collection",
|
||||
"add_to_collection": "Add to Collection",
|
||||
"delete": "Delete",
|
||||
"not_found": "Adventure not found",
|
||||
"not_found_desc": "The adventure you were looking for could not be found. Please try a different adventure or check back later.",
|
||||
"homepage": "Homepage",
|
||||
"adventure_details": "Adventure Details",
|
||||
"collection": "Collection",
|
||||
"adventure_type": "Adventure Type",
|
||||
"longitude": "Longitude",
|
||||
"latitude": "Latitude",
|
||||
"visit": "Visit",
|
||||
"visits": "Visits",
|
||||
"create_new": "Create New...",
|
||||
"adventure": "Adventure",
|
||||
"count_txt": "results matching your search",
|
||||
"sort": "Sort",
|
||||
"order_direction": "Order Direction",
|
||||
"order_by": "Order By",
|
||||
"ascending": "Ascending",
|
||||
"descending": "Descending",
|
||||
"updated": "Updated",
|
||||
"name": "Name",
|
||||
"date": "Date",
|
||||
"rating": "Rating",
|
||||
"sources": "Sources",
|
||||
"collection_adventures": "Include Collection Adventures",
|
||||
"filter": "Filter",
|
||||
"category_filter": "Category Filter",
|
||||
"clear": "Clear",
|
||||
"my_collections": "My Collections",
|
||||
"open_filters": "Open Filters",
|
||||
"close_filters": "Close Filters",
|
||||
"archived_collections": "Archived Collections",
|
||||
"share": "Share",
|
||||
"private": "Private",
|
||||
"public": "Public",
|
||||
"archived": "Archived",
|
||||
"edit_collection": "Edit Collection",
|
||||
"unarchive": "Unarchive",
|
||||
"archive": "Archive",
|
||||
"archived_collection_message": "Collection archived successfully!",
|
||||
"unarchived_collection_message": "Collection unarchived successfully!",
|
||||
"delete_collection_success": "Collection deleted successfully!",
|
||||
"delete_collection_warning": "Are you sure you want to delete this collection? This will also delete all of the linked adventures. This action cannot be undone.",
|
||||
"cancel": "Cancel",
|
||||
"delete_collection": "Delete Collection",
|
||||
"activities": {
|
||||
"general": "General 🌍",
|
||||
"outdoor": "Outdoor 🏞️",
|
||||
|
|
|
@ -89,6 +89,50 @@
|
|||
"water_sports": "Deportes acuáticos 🚤",
|
||||
"wildlife": "Vida silvestre 🦒"
|
||||
},
|
||||
"no_image_found": "No se encontró ninguna imagen"
|
||||
"no_image_found": "No se encontró ninguna imagen",
|
||||
"adventure_details": "Detalles de la aventura",
|
||||
"adventure_type": "Tipo de aventura",
|
||||
"collection": "Recopilación",
|
||||
"homepage": "Página principal",
|
||||
"latitude": "Latitud",
|
||||
"longitude": "Longitud",
|
||||
"not_found": "Aventura no encontrada",
|
||||
"not_found_desc": "La aventura que buscabas no se pudo encontrar. \nPruebe una aventura diferente o vuelva a consultar más tarde.",
|
||||
"visit": "Visita",
|
||||
"visits": "Visitas",
|
||||
"adventure": "Aventura",
|
||||
"count_txt": "resultados que coinciden con su búsqueda",
|
||||
"create_new": "Crear nuevo...",
|
||||
"ascending": "Ascendente",
|
||||
"collection_adventures": "Incluir aventuras de colección",
|
||||
"date": "Fecha",
|
||||
"descending": "Descendente",
|
||||
"filter": "Filtrar",
|
||||
"name": "Nombre",
|
||||
"order_by": "Ordenar por",
|
||||
"order_direction": "Dirección del pedido",
|
||||
"rating": "Clasificación",
|
||||
"sort": "Clasificar",
|
||||
"sources": "Fuentes",
|
||||
"updated": "Actualizado",
|
||||
"category_filter": "Filtro de categoría",
|
||||
"clear": "Claro",
|
||||
"archived_collections": "Colecciones archivadas",
|
||||
"close_filters": "Cerrar filtros",
|
||||
"my_collections": "Mis colecciones",
|
||||
"open_filters": "Abrir filtros",
|
||||
"private": "Privado",
|
||||
"public": "Público",
|
||||
"archived_collection_message": "¡Colección archivada exitosamente!",
|
||||
"delete_collection": "Eliminar colección",
|
||||
"delete_collection_success": "¡Colección eliminada exitosamente!",
|
||||
"delete_collection_warning": "¿Estás seguro de que deseas eliminar esta colección? \nEsto también eliminará todas las aventuras vinculadas. \nEsta acción no se puede deshacer.",
|
||||
"unarchived_collection_message": "¡Colección desarchivada exitosamente!",
|
||||
"archive": "Archivo",
|
||||
"archived": "Archivado",
|
||||
"edit_collection": "Editar colección",
|
||||
"share": "Compartir",
|
||||
"unarchive": "Desarchivar",
|
||||
"cancel": "Cancelar"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
import CategoryFilterDropdown from '$lib/components/CategoryFilterDropdown.svelte';
|
||||
import NotFound from '$lib/components/NotFound.svelte';
|
||||
import type { Adventure } from '$lib/types';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
import Plus from '~icons/mdi/plus';
|
||||
|
||||
|
@ -174,7 +175,7 @@
|
|||
tabindex="0"
|
||||
class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4"
|
||||
>
|
||||
<p class="text-center font-bold text-lg">Create new...</p>
|
||||
<p class="text-center font-bold text-lg">{$t('adventures.create_new')}</p>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
on:click={() => {
|
||||
|
@ -182,7 +183,7 @@
|
|||
adventureToEdit = null;
|
||||
}}
|
||||
>
|
||||
Adventure</button
|
||||
{$t('adventures.adventure')}</button
|
||||
>
|
||||
|
||||
<!-- <button
|
||||
|
@ -198,8 +199,8 @@
|
|||
<input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} />
|
||||
<div class="drawer-content">
|
||||
<!-- Page content -->
|
||||
<h1 class="text-center font-bold text-4xl mb-6">My Adventures</h1>
|
||||
<p class="text-center">This search returned {count} results.</p>
|
||||
<h1 class="text-center font-bold text-4xl mb-6">{$t('navbar.my_adventures')}</h1>
|
||||
<p class="text-center">{count} {$t('adventures.count_txt')}</p>
|
||||
{#if adventures.length === 0}
|
||||
<NotFound error={undefined} />
|
||||
{/if}
|
||||
|
@ -208,7 +209,7 @@
|
|||
class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]"
|
||||
on:click={toggleSidebar}
|
||||
>
|
||||
{sidebarOpen ? 'Close Filters' : 'Open Filters'}
|
||||
{sidebarOpen ? $t(`adventures.close_filters`) : $t(`adventures.open_filters`)}
|
||||
</button>
|
||||
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
|
@ -250,8 +251,8 @@
|
|||
<form method="get">
|
||||
<CategoryFilterDropdown bind:types={typeString} />
|
||||
<div class="divider"></div>
|
||||
<h3 class="text-center font-bold text-lg mb-4">Sort</h3>
|
||||
<p class="text-lg font-semibold mb-2">Order Direction</p>
|
||||
<h3 class="text-center font-bold text-lg mb-4">{$t('adventures.sort')}</h3>
|
||||
<p class="text-lg font-semibold mb-2">{$t('adventures.order_direction')}</p>
|
||||
<div class="join">
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
|
@ -259,7 +260,7 @@
|
|||
name="order_direction"
|
||||
id="asc"
|
||||
value="asc"
|
||||
aria-label="Ascending"
|
||||
aria-label={$t('adventures.ascending')}
|
||||
checked={currentSort.order === 'asc'}
|
||||
/>
|
||||
<input
|
||||
|
@ -268,55 +269,55 @@
|
|||
name="order_direction"
|
||||
id="desc"
|
||||
value="desc"
|
||||
aria-label="Descending"
|
||||
aria-label={$t('adventures.descending')}
|
||||
checked={currentSort.order === 'desc'}
|
||||
/>
|
||||
</div>
|
||||
<br />
|
||||
<p class="text-lg font-semibold mt-2 mb-2">Order By</p>
|
||||
<div class="flex join overflow-auto">
|
||||
<p class="text-lg font-semibold mt-2 mb-2">{$t('adventures.order_by')}</p>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
class="btn btn-neutral text-wrap"
|
||||
type="radio"
|
||||
name="order_by"
|
||||
id="updated_at"
|
||||
value="updated_at"
|
||||
aria-label="Updated"
|
||||
aria-label={$t('adventures.updated')}
|
||||
checked={currentSort.order_by === 'updated_at'}
|
||||
/>
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
class="btn btn-neutral text-wrap"
|
||||
type="radio"
|
||||
name="order_by"
|
||||
id="name"
|
||||
aria-label="Name"
|
||||
aria-label={$t('adventures.name')}
|
||||
value="name"
|
||||
checked={currentSort.order_by === 'name'}
|
||||
/>
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
class="btn btn-neutral text-wrap"
|
||||
type="radio"
|
||||
value="date"
|
||||
name="order_by"
|
||||
id="date"
|
||||
aria-label="Date"
|
||||
aria-label={$t('adventures.date')}
|
||||
checked={currentSort.order_by === 'date'}
|
||||
/>
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
class="btn btn-neutral text-wrap"
|
||||
type="radio"
|
||||
name="order_by"
|
||||
id="rating"
|
||||
aria-label="Rating"
|
||||
aria-label={$t('adventures.rating')}
|
||||
value="rating"
|
||||
checked={currentSort.order_by === 'rating'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<p class="text-lg font-semibold mt-2 mb-2">Sources</p>
|
||||
<p class="text-lg font-semibold mt-2 mb-2">{$t('adventures.sources')}</p>
|
||||
<label class="label cursor-pointer">
|
||||
<span class="label-text">Include Collection Adventures</span>
|
||||
<span class="label-text">{$t('adventures.collection_adventures')}</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="include_collections"
|
||||
|
@ -325,7 +326,7 @@
|
|||
checked={currentSort.includeCollections}
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" class="btn btn-success mt-4">Filter</button>
|
||||
<button type="submit" class="btn btn-success mt-4">{$t('adventures.filter')}</button>
|
||||
</form>
|
||||
</div>
|
||||
</ul>
|
||||
|
@ -333,6 +334,6 @@
|
|||
</div>
|
||||
|
||||
<svelte:head>
|
||||
<title>Adventures</title>
|
||||
<title>{$t('navbar.adventures')}</title>
|
||||
<meta name="description" content="View your completed and planned adventures." />
|
||||
</svelte:head>
|
||||
|
|
|
@ -49,14 +49,15 @@
|
|||
<img src={Lost} alt="Lost" class="w-1/2" />
|
||||
</div>
|
||||
<h1 class="mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl">
|
||||
Adventure not Found
|
||||
{$t('adventures.not_found')}
|
||||
</h1>
|
||||
<p class="mt-4 text-muted-foreground">
|
||||
The adventure you were looking for could not be found. Please try a different adventure or
|
||||
check back later.
|
||||
{$t('adventures.not_found_desc')}
|
||||
</p>
|
||||
<div class="mt-6">
|
||||
<button class="btn btn-primary" on:click={() => goto('/')}>Homepage</button>
|
||||
<button class="btn btn-primary" on:click={() => goto('/')}
|
||||
>{$t('adventures.homepage')}</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -258,18 +259,18 @@
|
|||
></div>
|
||||
<div class="grid gap-8">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold mt-4">Adventure Details</h2>
|
||||
<h2 class="text-2xl font-bold mt-4">{$t('adventures.adventure_details')}</h2>
|
||||
<div class="grid gap-4 mt-4">
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<p class="text-sm text-muted-foreground">Adventure Type</p>
|
||||
<p class="text-sm text-muted-foreground">{$t('adventures.adventure_type')}</p>
|
||||
<p class="text-base font-medium">
|
||||
{$t(`adventures.activities.${adventure.type}`)}
|
||||
</p>
|
||||
</div>
|
||||
{#if data.props.collection}
|
||||
<div>
|
||||
<p class="text-sm text-muted-foreground">Collection</p>
|
||||
<p class="text-sm text-muted-foreground">{$t('adventures.collection')}</p>
|
||||
<a
|
||||
class="text-base font-medium link"
|
||||
href="/collections/{data.props.collection.id}">{data.props.collection.name}</a
|
||||
|
@ -281,7 +282,9 @@
|
|||
<p class="text-sm text-muted-foreground">Visits</p>
|
||||
<p class="text-base font-medium">
|
||||
{adventure.visits.length}
|
||||
{adventure.visits.length > 1 ? 'visits' : 'visit' + ':'}
|
||||
{adventure.visits.length > 1
|
||||
? $t('adventures.visits')
|
||||
: $t('adventures.visit') + ':'}
|
||||
</p>
|
||||
<!-- show each visit start and end date as well as notes -->
|
||||
{#each adventure.visits as visit}
|
||||
|
@ -310,11 +313,11 @@
|
|||
{#if adventure.longitude && adventure.latitude}
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<p class="text-sm text-muted-foreground">Latitude</p>
|
||||
<p class="text-sm text-muted-foreground">{$t('adventures.latitude')}</p>
|
||||
<p class="text-base font-medium">{adventure.latitude}° N</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm text-muted-foreground">Longitude</p>
|
||||
<p class="text-sm text-muted-foreground">{$t('adventures.longitude')}</p>
|
||||
<p class="text-base font-medium">{adventure.longitude}° W</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -336,13 +339,6 @@
|
|||
<p class="font-semibold text-black text-md">
|
||||
{adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)}
|
||||
</p>
|
||||
<p>
|
||||
<!-- {adventure.date
|
||||
? new Date(adventure.date).toLocaleDateString(undefined, {
|
||||
timeZone: 'UTC'
|
||||
})
|
||||
: ''} -->
|
||||
</p>
|
||||
{#if adventure.visits.length > 0}
|
||||
<p class="text-black text-sm">
|
||||
{#each adventure.visits as visit}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import NewCollection from '$lib/components/NewCollection.svelte';
|
||||
import NotFound from '$lib/components/NotFound.svelte';
|
||||
import type { Collection } from '$lib/types';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
import Plus from '~icons/mdi/plus';
|
||||
|
||||
|
@ -142,7 +143,7 @@
|
|||
tabindex="0"
|
||||
class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4"
|
||||
>
|
||||
<p class="text-center font-bold text-lg">Create new...</p>
|
||||
<p class="text-center font-bold text-lg">{$t(`adventures.create_new`)}</p>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
on:click={() => {
|
||||
|
@ -150,7 +151,7 @@
|
|||
newType = 'visited';
|
||||
}}
|
||||
>
|
||||
Collection</button
|
||||
{$t(`adventures.collection`)}</button
|
||||
>
|
||||
|
||||
<!-- <button
|
||||
|
@ -166,8 +167,8 @@
|
|||
<input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} />
|
||||
<div class="drawer-content">
|
||||
<!-- Page content -->
|
||||
<h1 class="text-center font-bold text-4xl mb-6">My Collections</h1>
|
||||
<p class="text-center">This search returned {count} results.</p>
|
||||
<h1 class="text-center font-bold text-4xl mb-6">{$t(`adventures.my_collections`)}</h1>
|
||||
<p class="text-center">{count} {$t(`adventures.count_txt`)}</p>
|
||||
{#if collections.length === 0}
|
||||
<NotFound error={undefined} />
|
||||
{/if}
|
||||
|
@ -176,7 +177,7 @@
|
|||
class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]"
|
||||
on:click={toggleSidebar}
|
||||
>
|
||||
{sidebarOpen ? 'Close Filters' : 'Open Filters'}
|
||||
{sidebarOpen ? $t(`adventures.close_filters`) : $t(`adventures.open_filters`)}
|
||||
</button>
|
||||
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
|
@ -217,8 +218,8 @@
|
|||
<!-- Sidebar content here -->
|
||||
<div class="form-control">
|
||||
<form action="?/get" method="post" use:enhance={handleSubmit}>
|
||||
<h3 class="text-center font-semibold text-lg mb-4">Sort</h3>
|
||||
<p class="text-lg font-semibold mb-2">Order Direction</p>
|
||||
<h3 class="text-center font-semibold text-lg mb-4">{$t(`adventures.sort`)}</h3>
|
||||
<p class="text-lg font-semibold mb-2">{$t(`adventures.order_direction`)}</p>
|
||||
<div class="join">
|
||||
<input
|
||||
class="join-item btn btn-neutral"
|
||||
|
@ -226,7 +227,7 @@
|
|||
name="order_direction"
|
||||
id="asc"
|
||||
value="asc"
|
||||
aria-label="Ascending"
|
||||
aria-label={$t(`adventures.ascending`)}
|
||||
checked
|
||||
/>
|
||||
<input
|
||||
|
@ -235,7 +236,7 @@
|
|||
name="order_direction"
|
||||
id="desc"
|
||||
value="desc"
|
||||
aria-label="Descending"
|
||||
aria-label={$t(`adventures.descending`)}
|
||||
/>
|
||||
</div>
|
||||
<br />
|
||||
|
@ -249,13 +250,16 @@
|
|||
value="name"
|
||||
hidden
|
||||
/>
|
||||
<button type="submit" class="btn btn-success btn-primary mt-4">Sort</button>
|
||||
<button type="submit" class="btn btn-success btn-primary mt-4"
|
||||
>{$t(`adventures.sort`)}</button
|
||||
>
|
||||
</form>
|
||||
<div class="divider"></div>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-neutral btn-primary mt-4"
|
||||
on:click={() => goto('/collections/archived')}>Archived Collections</button
|
||||
on:click={() => goto('/collections/archived')}
|
||||
>{$t(`adventures.archived_collections`)}</button
|
||||
>
|
||||
</div>
|
||||
</ul>
|
||||
|
@ -263,6 +267,6 @@
|
|||
</div>
|
||||
|
||||
<svelte:head>
|
||||
<title>Collections</title>
|
||||
<title>{$t(`navbar.collections`)}</title>
|
||||
<meta name="description" content="View your adventure collections." />
|
||||
</svelte:head>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue