mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 12:59:36 +02:00
is visited
This commit is contained in:
parent
9d42dbac98
commit
727daf0cfd
10 changed files with 284 additions and 281 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
from django.utils import timezone
|
||||||
import os
|
import os
|
||||||
from .models import Adventure, AdventureImage, ChecklistItem, Collection, Note, Transportation, Checklist, Visit
|
from .models import Adventure, AdventureImage, ChecklistItem, Collection, Note, Transportation, Checklist, Visit
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
@ -19,18 +20,28 @@ class AdventureImageSerializer(serializers.ModelSerializer):
|
||||||
return representation
|
return representation
|
||||||
|
|
||||||
class VisitSerializer(serializers.ModelSerializer):
|
class VisitSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Visit
|
model = Visit
|
||||||
fields = ['id', 'start_date', 'end_date', 'notes']
|
fields = ['id', 'start_date', 'end_date', 'notes']
|
||||||
read_only_fields = ['id']
|
read_only_fields = ['id']
|
||||||
|
|
||||||
class AdventureSerializer(serializers.ModelSerializer):
|
class AdventureSerializer(serializers.ModelSerializer):
|
||||||
images = AdventureImageSerializer(many=True, read_only=True)
|
images = AdventureImageSerializer(many=True, read_only=True)
|
||||||
visits = VisitSerializer(many=True, read_only=False)
|
visits = VisitSerializer(many=True, read_only=False)
|
||||||
|
is_visited = serializers.SerializerMethodField()
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Adventure
|
model = Adventure
|
||||||
fields = ['id', 'user_id', 'name', 'description', 'rating', 'activity_types', 'location', 'is_public', 'collection', 'created_at', 'updated_at', 'images', 'link', 'type', 'longitude', 'latitude', 'visits']
|
fields = ['id', 'user_id', 'name', 'description', 'rating', 'activity_types', 'location', 'is_public', 'collection', 'created_at', 'updated_at', 'images', 'link', 'type', 'longitude', 'latitude', 'visits', 'is_visited']
|
||||||
read_only_fields = ['id', 'created_at', 'updated_at', 'user_id']
|
read_only_fields = ['id', 'created_at', 'updated_at', 'user_id', 'is_visited']
|
||||||
|
|
||||||
|
def get_is_visited(self, obj):
|
||||||
|
current_date = timezone.now().date()
|
||||||
|
for visit in obj.visits.all():
|
||||||
|
if visit.start_date and visit.end_date and (visit.start_date <= current_date):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def to_representation(self, instance):
|
def to_representation(self, instance):
|
||||||
representation = super().to_representation(instance)
|
representation = super().to_representation(instance)
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import CollectionLink from './CollectionLink.svelte';
|
import CollectionLink from './CollectionLink.svelte';
|
||||||
import DotsHorizontal from '~icons/mdi/dots-horizontal';
|
import DotsHorizontal from '~icons/mdi/dots-horizontal';
|
||||||
import DeleteWarning from './DeleteWarning.svelte';
|
import DeleteWarning from './DeleteWarning.svelte';
|
||||||
import { isAdventureVisited } from '$lib';
|
|
||||||
import CardCarousel from './CardCarousel.svelte';
|
import CardCarousel from './CardCarousel.svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="badge badge-primary">{$t(`adventures.activities.${adventure.type}`)}</div>
|
<div class="badge badge-primary">{$t(`adventures.activities.${adventure.type}`)}</div>
|
||||||
<div class="badge badge-success">
|
<div class="badge badge-success">
|
||||||
{isAdventureVisited(adventure) ? $t('adventures.visited') : $t('adventures.planned')}
|
{adventure.is_visited ? $t('adventures.visited') : $t('adventures.planned')}
|
||||||
</div>
|
</div>
|
||||||
<div class="badge badge-secondary">
|
<div class="badge badge-secondary">
|
||||||
{adventure.is_public ? $t('adventures.public') : $t('adventures.private')}
|
{adventure.is_public ? $t('adventures.public') : $t('adventures.private')}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
import ActivityComplete from './ActivityComplete.svelte';
|
import ActivityComplete from './ActivityComplete.svelte';
|
||||||
import { appVersion } from '$lib/config';
|
import { appVersion } from '$lib/config';
|
||||||
import { ADVENTURE_TYPES } from '$lib';
|
import { ADVENTURE_TYPES } from '$lib';
|
||||||
|
import RegionCard from './RegionCard.svelte';
|
||||||
|
|
||||||
let wikiError: string = '';
|
let wikiError: string = '';
|
||||||
|
|
||||||
|
@ -629,7 +630,11 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
||||||
{#if reverseGeocodePlace}
|
{#if reverseGeocodePlace}
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<p>{reverseGeocodePlace.region}, {reverseGeocodePlace.country}</p>
|
<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>
|
</div>
|
||||||
{#if !reverseGeocodePlace.is_visited}
|
{#if !reverseGeocodePlace.is_visited}
|
||||||
<div role="alert" class="alert alert-info mt-2">
|
<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>
|
></path>
|
||||||
</svg>
|
</svg>
|
||||||
<span
|
<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}>
|
<button type="button" class="btn btn-neutral" on:click={markVisited}>
|
||||||
Mark as Visited
|
{$t('adventures.mark_visited')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -253,28 +253,6 @@ export let ADVENTURE_TYPES = [
|
||||||
{ type: 'other', label: 'Other' }
|
{ type: 'other', label: 'Other' }
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if an adventure has been visited.
|
|
||||||
*
|
|
||||||
* This function determines if the `adventure.visits` array contains at least one visit
|
|
||||||
* with a `start_date` that is before the current date.
|
|
||||||
*
|
|
||||||
* @param adventure - The adventure object to check.
|
|
||||||
* @returns `true` if the adventure has been visited, otherwise `false`.
|
|
||||||
*/
|
|
||||||
export function isAdventureVisited(adventure: Adventure) {
|
|
||||||
const currentTime = Date.now();
|
|
||||||
|
|
||||||
// Check if any visit's start_date is before the current time.
|
|
||||||
return (
|
|
||||||
adventure.visits &&
|
|
||||||
adventure.visits.some((visit) => {
|
|
||||||
const visitStartTime = new Date(visit.start_date).getTime();
|
|
||||||
return visit.start_date && visitStartTime <= currentTime;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getRandomBackground() {
|
export function getRandomBackground() {
|
||||||
const randomIndex = Math.floor(Math.random() * randomBackgrounds.backgrounds.length);
|
const randomIndex = Math.floor(Math.random() * randomBackgrounds.backgrounds.length);
|
||||||
return randomBackgrounds.backgrounds[randomIndex] as Background;
|
return randomBackgrounds.backgrounds[randomIndex] as Background;
|
||||||
|
|
|
@ -37,6 +37,7 @@ export type Adventure = {
|
||||||
is_public: boolean;
|
is_public: boolean;
|
||||||
created_at?: string | null;
|
created_at?: string | null;
|
||||||
updated_at?: string | null;
|
updated_at?: string | null;
|
||||||
|
is_visited?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Country = {
|
export type Country = {
|
||||||
|
|
|
@ -139,6 +139,7 @@
|
||||||
"unarchive": "Unarchive",
|
"unarchive": "Unarchive",
|
||||||
"archive": "Archive",
|
"archive": "Archive",
|
||||||
"no_collections_found": "No collections found to add this adventure to.",
|
"no_collections_found": "No collections found to add this adventure to.",
|
||||||
|
"not_visited": "Not Visited",
|
||||||
"archived_collection_message": "Collection archived successfully!",
|
"archived_collection_message": "Collection archived successfully!",
|
||||||
"unarchived_collection_message": "Collection unarchived successfully!",
|
"unarchived_collection_message": "Collection unarchived successfully!",
|
||||||
"delete_collection_success": "Collection deleted successfully!",
|
"delete_collection_success": "Collection deleted successfully!",
|
||||||
|
@ -173,6 +174,8 @@
|
||||||
"basic_information": "Basic Information",
|
"basic_information": "Basic Information",
|
||||||
"adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!",
|
"adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!",
|
||||||
"no_adventures_found": "No adventures found",
|
"no_adventures_found": "No adventures found",
|
||||||
|
"mark_region_as_visited": "Mark region {region}, {country} as visited?",
|
||||||
|
"mark_visited": "Mark Visited",
|
||||||
"activities": {
|
"activities": {
|
||||||
"general": "General 🌍",
|
"general": "General 🌍",
|
||||||
"outdoor": "Outdoor 🏞️",
|
"outdoor": "Outdoor 🏞️",
|
||||||
|
|
|
@ -1,245 +1,248 @@
|
||||||
{
|
{
|
||||||
"navbar": {
|
"navbar": {
|
||||||
"adventures": "Aventuras",
|
"adventures": "Aventuras",
|
||||||
"collections": "Colecciones",
|
"collections": "Colecciones",
|
||||||
"worldtravel": "Viajar por el Mundo",
|
"worldtravel": "Viajar por el Mundo",
|
||||||
"map": "Mapa",
|
"map": "Mapa",
|
||||||
"users": "Usuarios",
|
"users": "Usuarios",
|
||||||
"search": "Buscar",
|
"search": "Buscar",
|
||||||
"profile": "Perfil",
|
"profile": "Perfil",
|
||||||
"greeting": "Hola",
|
"greeting": "Hola",
|
||||||
"my_adventures": "Mis Aventuras",
|
"my_adventures": "Mis Aventuras",
|
||||||
"my_activities": "Mis Actividades",
|
"my_activities": "Mis Actividades",
|
||||||
"shared_with_me": "Compartido Conmigo",
|
"shared_with_me": "Compartido Conmigo",
|
||||||
"settings": "Configuraciones",
|
"settings": "Configuraciones",
|
||||||
"logout": "Cerrar Sesión",
|
"logout": "Cerrar Sesión",
|
||||||
"about": "Acerca de AdventureLog",
|
"about": "Acerca de AdventureLog",
|
||||||
"documentation": "Documentación",
|
"documentation": "Documentación",
|
||||||
"discord": "Discord",
|
"discord": "Discord",
|
||||||
"theme_selection": "Selección de Tema",
|
"theme_selection": "Selección de Tema",
|
||||||
"themes": {
|
"themes": {
|
||||||
"light": "Claro",
|
"light": "Claro",
|
||||||
"dark": "Oscuro",
|
"dark": "Oscuro",
|
||||||
"night": "Noche",
|
"night": "Noche",
|
||||||
"forest": "Bosque",
|
"forest": "Bosque",
|
||||||
"aestetic-dark": "Estético Oscuro",
|
"aestetic-dark": "Estético Oscuro",
|
||||||
"aestetic-light": "Estético Claro",
|
"aestetic-light": "Estético Claro",
|
||||||
"aqua": "Aqua"
|
"aqua": "Aqua"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"about": {
|
"about": {
|
||||||
"about": "Acerca de",
|
"about": "Acerca de",
|
||||||
"license": "Licenciado bajo la Licencia GPL-3.0.",
|
"license": "Licenciado bajo la Licencia GPL-3.0.",
|
||||||
"source_code": "Código Fuente",
|
"source_code": "Código Fuente",
|
||||||
"message": "Hecho con ❤️ en los Estados Unidos.",
|
"message": "Hecho con ❤️ en los Estados Unidos.",
|
||||||
"oss_attributions": "Atribuciones de Código Abierto",
|
"oss_attributions": "Atribuciones de Código Abierto",
|
||||||
"nominatim_1": "La búsqueda de ubicaciones y geocodificación es proporcionada por",
|
"nominatim_1": "La búsqueda de ubicaciones y geocodificación es proporcionada por",
|
||||||
"nominatim_2": "Sus datos están licenciados bajo la licencia ODbL.",
|
"nominatim_2": "Sus datos están licenciados bajo la licencia ODbL.",
|
||||||
"other_attributions": "Atribuciones adicionales se pueden encontrar en el archivo README.",
|
"other_attributions": "Atribuciones adicionales se pueden encontrar en el archivo README.",
|
||||||
"close": "Cerrar"
|
"close": "Cerrar"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"hero_1": "Descubre las Aventuras Más Emocionantes del Mundo",
|
"hero_1": "Descubre las Aventuras Más Emocionantes del Mundo",
|
||||||
"hero_2": "Descubre y planifica tu próxima aventura con AdventureLog. Explora destinos impresionantes, crea itinerarios personalizados y mantente conectado en todo momento.",
|
"hero_2": "Descubre y planifica tu próxima aventura con AdventureLog. Explora destinos impresionantes, crea itinerarios personalizados y mantente conectado en todo momento.",
|
||||||
"go_to": "Ir a AdventureLog",
|
"go_to": "Ir a AdventureLog",
|
||||||
"key_features": "Características Clave",
|
"key_features": "Características Clave",
|
||||||
"desc_1": "Descubre, Planifica y Explora Fácilmente",
|
"desc_1": "Descubre, Planifica y Explora Fácilmente",
|
||||||
"desc_2": "AdventureLog está diseñado para simplificar tu viaje, brindándote las herramientas y recursos para planificar, empacar y navegar tu próxima aventura inolvidable.",
|
"desc_2": "AdventureLog está diseñado para simplificar tu viaje, brindándote las herramientas y recursos para planificar, empacar y navegar tu próxima aventura inolvidable.",
|
||||||
"feature_1": "Registro de Viajes",
|
"feature_1": "Registro de Viajes",
|
||||||
"feature_1_desc": "Mantén un registro de tus aventuras con un diario de viaje personalizado y comparte tus experiencias con amigos y familiares.",
|
"feature_1_desc": "Mantén un registro de tus aventuras con un diario de viaje personalizado y comparte tus experiencias con amigos y familiares.",
|
||||||
"feature_2": "Planificación de Viajes",
|
"feature_2": "Planificación de Viajes",
|
||||||
"feature_2_desc": "Crea fácilmente itinerarios personalizados y obtén un desglose diario de tu viaje.",
|
"feature_2_desc": "Crea fácilmente itinerarios personalizados y obtén un desglose diario de tu viaje.",
|
||||||
"feature_3": "Mapa de Viaje",
|
"feature_3": "Mapa de Viaje",
|
||||||
"feature_3_desc": "Visualiza tus viajes por el mundo con un mapa interactivo y explora nuevos destinos."
|
"feature_3_desc": "Visualiza tus viajes por el mundo con un mapa interactivo y explora nuevos destinos."
|
||||||
},
|
},
|
||||||
"adventures": {
|
"adventures": {
|
||||||
"collection_remove_success": "¡Aventura eliminada de la colección con éxito!",
|
"collection_remove_success": "¡Aventura eliminada de la colección con éxito!",
|
||||||
"collection_remove_error": "Error al eliminar la aventura de la colección",
|
"collection_remove_error": "Error al eliminar la aventura de la colección",
|
||||||
"collection_link_success": "¡Aventura vinculada a la colección con éxito!",
|
"collection_link_success": "¡Aventura vinculada a la colección con éxito!",
|
||||||
"collection_link_error": "Error al vincular la aventura a la colección",
|
"collection_link_error": "Error al vincular la aventura a la colección",
|
||||||
"adventure_delete_confirm": "¿Estás seguro de que quieres eliminar esta aventura? Esta acción no se puede deshacer.",
|
"adventure_delete_confirm": "¿Estás seguro de que quieres eliminar esta aventura? Esta acción no se puede deshacer.",
|
||||||
"open_details": "Abrir Detalles",
|
"open_details": "Abrir Detalles",
|
||||||
"edit_adventure": "Editar Aventura",
|
"edit_adventure": "Editar Aventura",
|
||||||
"remove_from_collection": "Eliminar de la Colección",
|
"remove_from_collection": "Eliminar de la Colección",
|
||||||
"add_to_collection": "Añadir a la Colección",
|
"add_to_collection": "Añadir a la Colección",
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"activities": {
|
"activities": {
|
||||||
"activity": "Actividad 🏄",
|
"activity": "Actividad 🏄",
|
||||||
"art_museums": "Arte",
|
"art_museums": "Arte",
|
||||||
"attraction": "Atracción 🎢",
|
"attraction": "Atracción 🎢",
|
||||||
"culture": "Cultura 🎭",
|
"culture": "Cultura 🎭",
|
||||||
"dining": "Cenar 🍽️",
|
"dining": "Cenar 🍽️",
|
||||||
"event": "Evento 🎉",
|
"event": "Evento 🎉",
|
||||||
"festivals": "Festivales 🎪",
|
"festivals": "Festivales 🎪",
|
||||||
"fitness": "Fitness 🏋️",
|
"fitness": "Fitness 🏋️",
|
||||||
"general": "Generales 🌍",
|
"general": "Generales 🌍",
|
||||||
"hiking": "Senderismo 🥾",
|
"hiking": "Senderismo 🥾",
|
||||||
"historical_sites": "Sitios Históricos 🏛️",
|
"historical_sites": "Sitios Históricos 🏛️",
|
||||||
"lodging": "Alojamiento 🛌",
|
"lodging": "Alojamiento 🛌",
|
||||||
"music_concerts": "Música",
|
"music_concerts": "Música",
|
||||||
"nightlife": "Vida nocturna 🌃",
|
"nightlife": "Vida nocturna 🌃",
|
||||||
"other": "Otro",
|
"other": "Otro",
|
||||||
"outdoor": "Al aire libre 🏞️",
|
"outdoor": "Al aire libre 🏞️",
|
||||||
"shopping": "Compras 🛍️",
|
"shopping": "Compras 🛍️",
|
||||||
"spiritual_journeys": "Viajes espirituales 🧘♀️",
|
"spiritual_journeys": "Viajes espirituales 🧘♀️",
|
||||||
"transportation": "Transporte 🚗",
|
"transportation": "Transporte 🚗",
|
||||||
"volunteer_work": "Trabajo voluntario 🤝",
|
"volunteer_work": "Trabajo voluntario 🤝",
|
||||||
"water_sports": "Deportes acuáticos 🚤",
|
"water_sports": "Deportes acuáticos 🚤",
|
||||||
"wildlife": "Vida silvestre 🦒"
|
"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_details": "Detalles de la aventura",
|
||||||
"adventure_type": "Tipo de aventura",
|
"adventure_type": "Tipo de aventura",
|
||||||
"collection": "Recopilación",
|
"collection": "Recopilación",
|
||||||
"homepage": "Página principal",
|
"homepage": "Página principal",
|
||||||
"latitude": "Latitud",
|
"latitude": "Latitud",
|
||||||
"longitude": "Longitud",
|
"longitude": "Longitud",
|
||||||
"not_found": "Aventura no encontrada",
|
"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.",
|
"not_found_desc": "La aventura que buscabas no se pudo encontrar. \nPruebe una aventura diferente o vuelva a consultar más tarde.",
|
||||||
"visit": "Visita",
|
"visit": "Visita",
|
||||||
"visits": "Visitas",
|
"visits": "Visitas",
|
||||||
"adventure": "Aventura",
|
"adventure": "Aventura",
|
||||||
"count_txt": "resultados que coinciden con su búsqueda",
|
"count_txt": "resultados que coinciden con su búsqueda",
|
||||||
"create_new": "Crear nuevo...",
|
"create_new": "Crear nuevo...",
|
||||||
"ascending": "Ascendente",
|
"ascending": "Ascendente",
|
||||||
"collection_adventures": "Incluir aventuras de colección",
|
"collection_adventures": "Incluir aventuras de colección",
|
||||||
"date": "Fecha",
|
"date": "Fecha",
|
||||||
"descending": "Descendente",
|
"descending": "Descendente",
|
||||||
"filter": "Filtrar",
|
"filter": "Filtrar",
|
||||||
"name": "Nombre",
|
"name": "Nombre",
|
||||||
"order_by": "Ordenar por",
|
"order_by": "Ordenar por",
|
||||||
"order_direction": "Dirección del pedido",
|
"order_direction": "Dirección del pedido",
|
||||||
"rating": "Clasificación",
|
"rating": "Clasificación",
|
||||||
"sort": "Clasificar",
|
"sort": "Clasificar",
|
||||||
"sources": "Fuentes",
|
"sources": "Fuentes",
|
||||||
"updated": "Actualizado",
|
"updated": "Actualizado",
|
||||||
"category_filter": "Filtro de categoría",
|
"category_filter": "Filtro de categoría",
|
||||||
"clear": "Claro",
|
"clear": "Claro",
|
||||||
"archived_collections": "Colecciones archivadas",
|
"archived_collections": "Colecciones archivadas",
|
||||||
"close_filters": "Cerrar filtros",
|
"close_filters": "Cerrar filtros",
|
||||||
"my_collections": "Mis colecciones",
|
"my_collections": "Mis colecciones",
|
||||||
"open_filters": "Abrir filtros",
|
"open_filters": "Abrir filtros",
|
||||||
"private": "Privado",
|
"private": "Privado",
|
||||||
"public": "Público",
|
"public": "Público",
|
||||||
"archived_collection_message": "¡Colección archivada exitosamente!",
|
"archived_collection_message": "¡Colección archivada exitosamente!",
|
||||||
"delete_collection": "Eliminar colección",
|
"delete_collection": "Eliminar colección",
|
||||||
"delete_collection_success": "¡Colección eliminada exitosamente!",
|
"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.",
|
"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!",
|
"unarchived_collection_message": "¡Colección desarchivada exitosamente!",
|
||||||
"archive": "Archivo",
|
"archive": "Archivo",
|
||||||
"archived": "Archivado",
|
"archived": "Archivado",
|
||||||
"edit_collection": "Editar colección",
|
"edit_collection": "Editar colección",
|
||||||
"share": "Compartir",
|
"share": "Compartir",
|
||||||
"unarchive": "Desarchivar",
|
"unarchive": "Desarchivar",
|
||||||
"cancel": "Cancelar",
|
"cancel": "Cancelar",
|
||||||
"adventure_delete_success": "¡Aventura eliminada con éxito!",
|
"adventure_delete_success": "¡Aventura eliminada con éxito!",
|
||||||
"delete_adventure": "Eliminar aventura",
|
"delete_adventure": "Eliminar aventura",
|
||||||
"planned": "Planificado",
|
"planned": "Planificado",
|
||||||
"visited": "Visitado",
|
"visited": "Visitado",
|
||||||
"dates": "Fechas",
|
"dates": "Fechas",
|
||||||
"duration": "Duración",
|
"duration": "Duración",
|
||||||
"image_removed_error": "Error al eliminar la imagen",
|
"image_removed_error": "Error al eliminar la imagen",
|
||||||
"image_removed_success": "¡Imagen eliminada exitosamente!",
|
"image_removed_success": "¡Imagen eliminada exitosamente!",
|
||||||
"image_upload_error": "Error al subir la imagen",
|
"image_upload_error": "Error al subir la imagen",
|
||||||
"image_upload_success": "¡Imagen cargada exitosamente!",
|
"image_upload_success": "¡Imagen cargada exitosamente!",
|
||||||
"no_image_url": "No se encontró ninguna imagen en esa URL.",
|
"no_image_url": "No se encontró ninguna imagen en esa URL.",
|
||||||
"start_before_end_error": "La fecha de inicio debe ser anterior a la fecha de finalización.",
|
"start_before_end_error": "La fecha de inicio debe ser anterior a la fecha de finalización.",
|
||||||
"wiki_image_error": "Error al obtener la imagen de Wikipedia",
|
"wiki_image_error": "Error al obtener la imagen de Wikipedia",
|
||||||
"actions": "Comportamiento",
|
"actions": "Comportamiento",
|
||||||
"activity": "Actividad",
|
"activity": "Actividad",
|
||||||
"see_adventures": "Ver Aventuras",
|
"see_adventures": "Ver Aventuras",
|
||||||
"activity_types": "Tipos de actividad",
|
"activity_types": "Tipos de actividad",
|
||||||
"add": "Agregar",
|
"add": "Agregar",
|
||||||
"add_notes": "Agregar notas",
|
"add_notes": "Agregar notas",
|
||||||
"adventure_create_error": "No se pudo crear la aventura",
|
"adventure_create_error": "No se pudo crear la aventura",
|
||||||
"adventure_created": "Aventura creada",
|
"adventure_created": "Aventura creada",
|
||||||
"adventure_update_error": "No se pudo actualizar la aventura",
|
"adventure_update_error": "No se pudo actualizar la aventura",
|
||||||
"adventure_updated": "Aventura actualizada",
|
"adventure_updated": "Aventura actualizada",
|
||||||
"basic_information": "Información básica",
|
"basic_information": "Información básica",
|
||||||
"category": "Categoría",
|
"category": "Categoría",
|
||||||
"clear_map": "Borrar mapa",
|
"clear_map": "Borrar mapa",
|
||||||
"copy_link": "Copiar enlace",
|
"copy_link": "Copiar enlace",
|
||||||
"date_constrain": "Restringir a las fechas de recolección",
|
"date_constrain": "Restringir a las fechas de recolección",
|
||||||
"description": "Descripción",
|
"description": "Descripción",
|
||||||
"end_date": "Fecha de finalización",
|
"end_date": "Fecha de finalización",
|
||||||
"fetch_image": "Obtener imagen",
|
"fetch_image": "Obtener imagen",
|
||||||
"generate_desc": "Generar descripción",
|
"generate_desc": "Generar descripción",
|
||||||
"image": "Imagen",
|
"image": "Imagen",
|
||||||
"image_fetch_failed": "No se pudo recuperar la imagen",
|
"image_fetch_failed": "No se pudo recuperar la imagen",
|
||||||
"link": "Enlace",
|
"link": "Enlace",
|
||||||
"location": "Ubicación",
|
"location": "Ubicación",
|
||||||
"location_information": "Información de ubicación",
|
"location_information": "Información de ubicación",
|
||||||
"my_images": "Mis imágenes",
|
"my_images": "Mis imágenes",
|
||||||
"my_visits": "Mis visitas",
|
"my_visits": "Mis visitas",
|
||||||
"new_adventure": "Nueva aventura",
|
"new_adventure": "Nueva aventura",
|
||||||
"no_description_found": "No se encontró ninguna descripción",
|
"no_description_found": "No se encontró ninguna descripción",
|
||||||
"no_images": "Sin imágenes",
|
"no_images": "Sin imágenes",
|
||||||
"no_location": "Por favor ingresa una ubicación",
|
"no_location": "Por favor ingresa una ubicación",
|
||||||
"no_results": "No se encontraron resultados",
|
"no_results": "No se encontraron resultados",
|
||||||
"no_start_date": "Por favor ingrese una fecha de inicio",
|
"no_start_date": "Por favor ingrese una fecha de inicio",
|
||||||
"public_adventure": "Aventura pública",
|
"public_adventure": "Aventura pública",
|
||||||
"remove": "Eliminar",
|
"remove": "Eliminar",
|
||||||
"save_next": "Ahorrar",
|
"save_next": "Ahorrar",
|
||||||
"search_for_location": "Buscar una ubicación",
|
"search_for_location": "Buscar una ubicación",
|
||||||
"search_results": "Resultados de búsqueda",
|
"search_results": "Resultados de búsqueda",
|
||||||
"select_adventure_category": "Seleccionar categoría de aventura",
|
"select_adventure_category": "Seleccionar categoría de aventura",
|
||||||
"share_adventure": "¡Comparte esta aventura!",
|
"share_adventure": "¡Comparte esta aventura!",
|
||||||
"start_date": "Fecha de inicio",
|
"start_date": "Fecha de inicio",
|
||||||
"upload_image": "Subir imagen",
|
"upload_image": "Subir imagen",
|
||||||
"upload_images_here": "Sube imágenes aquí",
|
"upload_images_here": "Sube imágenes aquí",
|
||||||
"url": "URL",
|
"url": "URL",
|
||||||
"warning": "Advertencia",
|
"warning": "Advertencia",
|
||||||
"wiki_desc": "Extrae un extracto de un artículo de Wikipedia que coincide con el nombre de la aventura.",
|
"wiki_desc": "Extrae un extracto de un artículo de Wikipedia que coincide con el nombre de la aventura.",
|
||||||
"wikipedia": "Wikipedia",
|
"wikipedia": "Wikipedia",
|
||||||
"add_an_activity": "Agregar una actividad",
|
"add_an_activity": "Agregar una actividad",
|
||||||
"adventure_not_found": "No hay aventuras que mostrar. \n¡Agregue algunos usando el botón más en la parte inferior derecha o intente cambiar los filtros!",
|
"adventure_not_found": "No hay aventuras que mostrar. \n¡Agregue algunos usando el botón más en la parte inferior derecha o intente cambiar los filtros!",
|
||||||
"no_adventures_found": "No se encontraron aventuras",
|
"no_adventures_found": "No se encontraron aventuras",
|
||||||
"no_collections_found": "No se encontraron colecciones para agregar esta aventura.",
|
"no_collections_found": "No se encontraron colecciones para agregar esta aventura.",
|
||||||
"my_adventures": "mis aventuras",
|
"my_adventures": "mis aventuras",
|
||||||
"no_linkable_adventures": "No se encontraron aventuras que puedan vincularse a esta colección."
|
"no_linkable_adventures": "No se encontraron aventuras que puedan vincularse a esta colección.",
|
||||||
},
|
"mark_region_as_visited": "¿Marcar región {region}, {country} como visitada?",
|
||||||
"worldtravel": {
|
"mark_visited": "Marcos visitó",
|
||||||
"all": "Todo",
|
"not_visited": "No visitado"
|
||||||
"all_subregions": "Todas las subregiones",
|
},
|
||||||
"clear_search": "Borrar búsqueda",
|
"worldtravel": {
|
||||||
"completely_visited": "Completamente visitado",
|
"all": "Todo",
|
||||||
"no_countries_found": "No se encontraron países",
|
"all_subregions": "Todas las subregiones",
|
||||||
"not_visited": "No visitado",
|
"clear_search": "Borrar búsqueda",
|
||||||
"num_countries": "países encontrados",
|
"completely_visited": "Completamente visitado",
|
||||||
"partially_visited": "Parcialmente visitado",
|
"no_countries_found": "No se encontraron países",
|
||||||
"country_list": "Lista de países"
|
"not_visited": "No visitado",
|
||||||
},
|
"num_countries": "países encontrados",
|
||||||
"auth": {
|
"partially_visited": "Parcialmente visitado",
|
||||||
"forgot_password": "¿Has olvidado tu contraseña?",
|
"country_list": "Lista de países"
|
||||||
"login": "Acceso",
|
},
|
||||||
"login_error": "No se puede iniciar sesión con las credenciales proporcionadas.",
|
"auth": {
|
||||||
"password": "Contraseña",
|
"forgot_password": "¿Has olvidado tu contraseña?",
|
||||||
"signup": "Inscribirse",
|
"login": "Acceso",
|
||||||
"username": "Nombre de usuario",
|
"login_error": "No se puede iniciar sesión con las credenciales proporcionadas.",
|
||||||
"confirm_password": "confirmar Contraseña",
|
"password": "Contraseña",
|
||||||
"email": "Correo electrónico",
|
"signup": "Inscribirse",
|
||||||
"first_name": "Nombre de pila",
|
"username": "Nombre de usuario",
|
||||||
"last_name": "Apellido",
|
"confirm_password": "confirmar Contraseña",
|
||||||
"registration_disabled": "El registro está actualmente deshabilitado.",
|
"email": "Correo electrónico",
|
||||||
"profile_picture": "Foto de perfil",
|
"first_name": "Nombre de pila",
|
||||||
"public_profile": "Perfil público",
|
"last_name": "Apellido",
|
||||||
"public_tooltip": "Con un perfil público, los usuarios pueden compartir colecciones con usted y ver su perfil en la página de usuarios."
|
"registration_disabled": "El registro está actualmente deshabilitado.",
|
||||||
},
|
"profile_picture": "Foto de perfil",
|
||||||
"users": {
|
"public_profile": "Perfil público",
|
||||||
"no_users_found": "No se encontraron usuarios con perfiles públicos."
|
"public_tooltip": "Con un perfil público, los usuarios pueden compartir colecciones con usted y ver su perfil en la página de usuarios."
|
||||||
},
|
},
|
||||||
"settings": {
|
"users": {
|
||||||
"account_settings": "Configuración de cuenta de usuario",
|
"no_users_found": "No se encontraron usuarios con perfiles públicos."
|
||||||
"confirm_new_password": "Confirmar nueva contraseña",
|
},
|
||||||
"current_email": "Correo electrónico actual",
|
"settings": {
|
||||||
"email_change": "Cambiar correo electrónico",
|
"account_settings": "Configuración de cuenta de usuario",
|
||||||
"new_email": "Nuevo correo electrónico",
|
"confirm_new_password": "Confirmar nueva contraseña",
|
||||||
"new_password": "Nueva contraseña",
|
"current_email": "Correo electrónico actual",
|
||||||
"no_email_set": "No hay correo electrónico configurado",
|
"email_change": "Cambiar correo electrónico",
|
||||||
"password_change": "Cambiar la contraseña",
|
"new_email": "Nuevo correo electrónico",
|
||||||
"settings_page": "Página de configuración",
|
"new_password": "Nueva contraseña",
|
||||||
"update": "Actualizar",
|
"no_email_set": "No hay correo electrónico configurado",
|
||||||
"update_error": "Error al actualizar la configuración",
|
"password_change": "Cambiar la contraseña",
|
||||||
"update_success": "¡La configuración se actualizó correctamente!"
|
"settings_page": "Página de configuración",
|
||||||
}
|
"update": "Actualizar",
|
||||||
|
"update_error": "Error al actualizar la configuración",
|
||||||
|
"update_success": "¡La configuración se actualizó correctamente!"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
groupAdventuresByDate,
|
groupAdventuresByDate,
|
||||||
groupNotesByDate,
|
groupNotesByDate,
|
||||||
groupTransportationsByDate,
|
groupTransportationsByDate,
|
||||||
groupChecklistsByDate,
|
groupChecklistsByDate
|
||||||
isAdventureVisited
|
|
||||||
} from '$lib';
|
} from '$lib';
|
||||||
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
|
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
|
||||||
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
|
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
|
||||||
|
@ -45,7 +44,7 @@
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
numAdventures = adventures.length;
|
numAdventures = adventures.length;
|
||||||
numVisited = adventures.filter(isAdventureVisited).length;
|
numVisited = adventures.filter((adventure) => adventure.is_visited).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
let notFound: boolean = false;
|
let notFound: boolean = false;
|
||||||
|
|
|
@ -46,6 +46,7 @@ export const load = (async (event) => {
|
||||||
name: adventure.name,
|
name: adventure.name,
|
||||||
visits: adventure.visits,
|
visits: adventure.visits,
|
||||||
type: adventure.type,
|
type: adventure.type,
|
||||||
|
is_visited: adventure.is_visited
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { isAdventureVisited } from '$lib';
|
|
||||||
import AdventureModal from '$lib/components/AdventureModal.svelte';
|
import AdventureModal from '$lib/components/AdventureModal.svelte';
|
||||||
import {
|
import {
|
||||||
DefaultMarker,
|
DefaultMarker,
|
||||||
|
@ -25,8 +24,7 @@
|
||||||
let showPlanned = true;
|
let showPlanned = true;
|
||||||
|
|
||||||
$: filteredMarkers = markers.filter(
|
$: filteredMarkers = markers.filter(
|
||||||
(marker) =>
|
(marker) => (showVisited && marker.is_visited) || (showPlanned && !marker.is_visited)
|
||||||
(showVisited && isAdventureVisited(marker)) || (showPlanned && !isAdventureVisited(marker))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let newMarker = [];
|
let newMarker = [];
|
||||||
|
@ -145,7 +143,7 @@
|
||||||
standardControls
|
standardControls
|
||||||
>
|
>
|
||||||
{#each filteredMarkers as marker}
|
{#each filteredMarkers as marker}
|
||||||
{#if isAdventureVisited(marker)}
|
{#if marker.is_visited}
|
||||||
<Marker
|
<Marker
|
||||||
lngLat={marker.lngLat}
|
lngLat={marker.lngLat}
|
||||||
on:click={() => (clickedName = marker.name)}
|
on:click={() => (clickedName = marker.name)}
|
||||||
|
@ -205,7 +203,7 @@
|
||||||
<div class="text-lg text-black font-bold">{marker.name}</div>
|
<div class="text-lg text-black font-bold">{marker.name}</div>
|
||||||
<p class="font-semibold text-black text-md">Planned</p>
|
<p class="font-semibold text-black text-md">Planned</p>
|
||||||
<p class="font-semibold text-black text-md">
|
<p class="font-semibold text-black text-md">
|
||||||
{$t(`adventures.activities.${marker.type}`)}}
|
{$t(`adventures.activities.${marker.type}`)}
|
||||||
</p>
|
</p>
|
||||||
{#if marker.visits && marker.visits.length > 0}
|
{#if marker.visits && marker.visits.length > 0}
|
||||||
<p class="text-black text-sm">
|
<p class="text-black text-sm">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue