1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-30 02:09:37 +02:00

feat: enhance attachment handling with new localization strings and GPX upload tips

This commit is contained in:
Sean Morley 2025-01-21 19:33:48 -05:00
parent 1b3cf6ab39
commit 6e28e5234e
13 changed files with 142 additions and 19 deletions

View file

@ -997,7 +997,7 @@ it would also work to just use on:click on the MapLibre component itself. -->
<input <input
type="text" type="text"
class="input input-bordered w-full" class="input input-bordered w-full"
placeholder="Attachment Name" placeholder={$t('adventures.attachment_name')}
bind:value={attachmentName} bind:value={attachmentName}
/> />
<button type="submit" class="btn btn-neutral">{$t('adventures.upload')}</button> <button type="submit" class="btn btn-neutral">{$t('adventures.upload')}</button>
@ -1014,7 +1014,7 @@ it would also work to just use on:click on the MapLibre component itself. -->
<input <input
type="text" type="text"
class="input input-bordered w-full" class="input input-bordered w-full"
placeholder="Attachment Name" placeholder={$t('adventures.attachment_name')}
bind:value={attachmentToEdit.name} bind:value={attachmentToEdit.name}
/> />
<button type="submit" class="btn btn-neutral" <button type="submit" class="btn btn-neutral"

View file

@ -75,13 +75,15 @@
{attachment.name} {attachment.name}
</span> </span>
<div class="flex space-x-2"> <div class="flex space-x-2">
<button {#if !allowEdit}
class="btn btn-sm btn-secondary btn-outline" <button
type="button" class="btn btn-sm btn-secondary btn-outline"
on:click={() => window.open(attachment.file, '_blank')} type="button"
> on:click={() => window.open(attachment.file, '_blank')}
{$t('notes.open')} >
</button> {$t('notes.open')}
</button>
{/if}
{#if allowEdit} {#if allowEdit}
<button <button
class="btn btn-sm btn-info btn-outline" class="btn btn-sm btn-info btn-outline"

View file

@ -221,7 +221,20 @@
"cities_updated": "Städte aktualisiert", "cities_updated": "Städte aktualisiert",
"create_adventure": "Erstelle Abenteuer", "create_adventure": "Erstelle Abenteuer",
"no_adventures_to_recommendations": "Keine Abenteuer gefunden. \nFügen Sie mindestens ein Abenteuer hinzu, um Empfehlungen zu erhalten.", "no_adventures_to_recommendations": "Keine Abenteuer gefunden. \nFügen Sie mindestens ein Abenteuer hinzu, um Empfehlungen zu erhalten.",
"finding_recommendations": "Entdecken Sie verborgene Schätze für Ihr nächstes Abenteuer" "finding_recommendations": "Entdecken Sie verborgene Schätze für Ihr nächstes Abenteuer",
"attachment": "Anhang",
"attachment_delete_success": "Anhang erfolgreich gelöscht!",
"attachment_name": "Anhangsname",
"attachment_update_error": "Fehler beim Aktualisieren des Anhangs",
"attachment_update_success": "Anhang erfolgreich aktualisiert!",
"attachment_upload_error": "Fehler beim Hochladen des Anhangs",
"attachment_upload_success": "Anhang erfolgreich hochgeladen!",
"attachments": "Anhänge",
"gpx_tip": "Laden Sie GPX-Dateien als Anhänge hoch, um sie auf der Karte anzuzeigen!",
"images": "Bilder",
"primary": "Primär",
"upload": "Hochladen",
"view_attachment": "Anhang anzeigen"
}, },
"home": { "home": {
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit", "desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",

View file

@ -255,6 +255,8 @@
"upload": "Upload", "upload": "Upload",
"attachment_delete_success": "Attachment deleted successfully!", "attachment_delete_success": "Attachment deleted successfully!",
"attachment_update_success": "Attachment updated successfully!", "attachment_update_success": "Attachment updated successfully!",
"attachment_name": "Attachment Name",
"gpx_tip": "Upload GPX files to attachments to view them on the map!",
"attachment_update_error": "Error updating attachment", "attachment_update_error": "Error updating attachment",
"activities": { "activities": {
"general": "General 🌍", "general": "General 🌍",

View file

@ -268,7 +268,20 @@
"cities_updated": "ciudades actualizadas", "cities_updated": "ciudades actualizadas",
"create_adventure": "Crear aventura", "create_adventure": "Crear aventura",
"no_adventures_to_recommendations": "No se encontraron aventuras. \nAñade al menos una aventura para obtener recomendaciones.", "no_adventures_to_recommendations": "No se encontraron aventuras. \nAñade al menos una aventura para obtener recomendaciones.",
"finding_recommendations": "Descubriendo gemas ocultas para tu próxima aventura" "finding_recommendations": "Descubriendo gemas ocultas para tu próxima aventura",
"attachment": "Adjunto",
"attachment_delete_success": "¡El archivo adjunto se eliminó exitosamente!",
"attachment_update_error": "Error al actualizar el archivo adjunto",
"attachment_update_success": "¡Adjunto actualizado exitosamente!",
"attachment_upload_error": "Error al cargar el archivo adjunto",
"attachment_upload_success": "¡El archivo adjunto se cargó exitosamente!",
"attachments": "Adjuntos",
"gpx_tip": "¡Sube archivos GPX a archivos adjuntos para verlos en el mapa!",
"images": "Imágenes",
"primary": "Primario",
"upload": "Subir",
"view_attachment": "Ver archivo adjunto",
"attachment_name": "Nombre del archivo adjunto"
}, },
"worldtravel": { "worldtravel": {
"all": "Todo", "all": "Todo",

View file

@ -221,7 +221,20 @@
"cities_updated": "villes mises à jour", "cities_updated": "villes mises à jour",
"create_adventure": "Créer une aventure", "create_adventure": "Créer une aventure",
"no_adventures_to_recommendations": "Aucune aventure trouvée. \nAjoutez au moins une aventure pour obtenir des recommandations.", "no_adventures_to_recommendations": "Aucune aventure trouvée. \nAjoutez au moins une aventure pour obtenir des recommandations.",
"finding_recommendations": "Découvrir des trésors cachés pour votre prochaine aventure" "finding_recommendations": "Découvrir des trésors cachés pour votre prochaine aventure",
"attachment": "Pièce jointe",
"attachment_delete_success": "Pièce jointe supprimée avec succès !",
"attachment_name": "Nom de la pièce jointe",
"attachment_update_error": "Erreur lors de la mise à jour de la pièce jointe",
"attachment_update_success": "Pièce jointe mise à jour avec succès !",
"attachment_upload_error": "Erreur lors du téléchargement de la pièce jointe",
"attachment_upload_success": "Pièce jointe téléchargée avec succès !",
"attachments": "Pièces jointes",
"gpx_tip": "Téléchargez des fichiers GPX en pièces jointes pour les afficher sur la carte !",
"images": "Images",
"primary": "Primaire",
"upload": "Télécharger",
"view_attachment": "Voir la pièce jointe"
}, },
"home": { "home": {
"desc_1": "Découvrez, planifiez et explorez en toute simplicité", "desc_1": "Découvrez, planifiez et explorez en toute simplicité",

View file

@ -221,7 +221,20 @@
"cities_updated": "città aggiornate", "cities_updated": "città aggiornate",
"create_adventure": "Crea Avventura", "create_adventure": "Crea Avventura",
"no_adventures_to_recommendations": "Nessuna avventura trovata. \nAggiungi almeno un'avventura per ricevere consigli.", "no_adventures_to_recommendations": "Nessuna avventura trovata. \nAggiungi almeno un'avventura per ricevere consigli.",
"finding_recommendations": "Alla scoperta di gemme nascoste per la tua prossima avventura" "finding_recommendations": "Alla scoperta di gemme nascoste per la tua prossima avventura",
"attachment": "Allegato",
"attachment_delete_success": "Allegato eliminato con successo!",
"attachment_name": "Nome dell'allegato",
"attachment_update_error": "Errore durante l'aggiornamento dell'allegato",
"attachment_update_success": "Allegato aggiornato con successo!",
"attachment_upload_error": "Errore durante il caricamento dell'allegato",
"attachment_upload_success": "Allegato caricato con successo!",
"attachments": "Allegati",
"gpx_tip": "Carica i file GPX negli allegati per visualizzarli sulla mappa!",
"images": "Immagini",
"primary": "Primario",
"upload": "Caricamento",
"view_attachment": "Visualizza allegato"
}, },
"home": { "home": {
"desc_1": "Scopri, pianifica ed esplora con facilità", "desc_1": "Scopri, pianifica ed esplora con facilità",

View file

@ -221,7 +221,20 @@
"cities_updated": "steden bijgewerkt", "cities_updated": "steden bijgewerkt",
"create_adventure": "Creëer avontuur", "create_adventure": "Creëer avontuur",
"no_adventures_to_recommendations": "Geen avonturen gevonden. \nVoeg ten minste één avontuur toe om aanbevelingen te krijgen.", "no_adventures_to_recommendations": "Geen avonturen gevonden. \nVoeg ten minste één avontuur toe om aanbevelingen te krijgen.",
"finding_recommendations": "Ontdek verborgen juweeltjes voor je volgende avontuur" "finding_recommendations": "Ontdek verborgen juweeltjes voor je volgende avontuur",
"attachment": "Bijlage",
"attachment_delete_success": "Bijlage succesvol verwijderd!",
"attachment_name": "Naam van bijlage",
"attachment_update_error": "Fout bij bijwerken van bijlage",
"attachment_update_success": "Bijlage succesvol bijgewerkt!",
"attachment_upload_error": "Fout bij het uploaden van bijlage",
"attachment_upload_success": "Bijlage succesvol geüpload!",
"attachments": "Bijlagen",
"gpx_tip": "Upload GPX-bestanden naar bijlagen om ze op de kaart te bekijken!",
"images": "Afbeeldingen",
"primary": "Primair",
"upload": "Uploaden",
"view_attachment": "Bijlage bekijken"
}, },
"home": { "home": {
"desc_1": "Ontdek, plan en verken met gemak", "desc_1": "Ontdek, plan en verken met gemak",

View file

@ -268,7 +268,20 @@
"cities_updated": "miasta zaktualizowane", "cities_updated": "miasta zaktualizowane",
"create_adventure": "Stwórz przygodę", "create_adventure": "Stwórz przygodę",
"no_adventures_to_recommendations": "Nie znaleziono żadnych przygód. \nDodaj co najmniej jedną przygodę, aby uzyskać rekomendacje.", "no_adventures_to_recommendations": "Nie znaleziono żadnych przygód. \nDodaj co najmniej jedną przygodę, aby uzyskać rekomendacje.",
"finding_recommendations": "Odkrywanie ukrytych klejnotów na następną przygodę" "finding_recommendations": "Odkrywanie ukrytych klejnotów na następną przygodę",
"attachment": "Załącznik",
"attachment_delete_success": "Załącznik został pomyślnie usunięty!",
"attachment_name": "Nazwa załącznika",
"attachment_update_error": "Błąd podczas aktualizacji załącznika",
"attachment_update_success": "Załącznik został pomyślnie zaktualizowany!",
"attachment_upload_error": "Błąd podczas przesyłania załącznika",
"attachment_upload_success": "Załącznik przesłany pomyślnie!",
"attachments": "Załączniki",
"gpx_tip": "Przesyłaj pliki GPX do załączników, aby wyświetlić je na mapie!",
"images": "Obrazy",
"primary": "Podstawowy",
"upload": "Wgrywać",
"view_attachment": "Zobacz załącznik"
}, },
"worldtravel": { "worldtravel": {
"country_list": "Lista krajów", "country_list": "Lista krajów",

View file

@ -221,7 +221,20 @@
"cities_updated": "städer uppdaterade", "cities_updated": "städer uppdaterade",
"create_adventure": "Skapa äventyr", "create_adventure": "Skapa äventyr",
"no_adventures_to_recommendations": "Inga äventyr hittades. \nLägg till minst ett äventyr för att få rekommendationer.", "no_adventures_to_recommendations": "Inga äventyr hittades. \nLägg till minst ett äventyr för att få rekommendationer.",
"finding_recommendations": "Upptäck dolda pärlor för ditt nästa äventyr" "finding_recommendations": "Upptäck dolda pärlor för ditt nästa äventyr",
"attachment": "Fastsättning",
"attachment_delete_success": "Bilagan har raderats!",
"attachment_name": "Bilagans namn",
"attachment_update_error": "Fel vid uppdatering av bilaga",
"attachment_update_success": "Bilagan har uppdaterats!",
"attachment_upload_error": "Det gick inte att ladda upp bilagan",
"attachment_upload_success": "Bilagan har laddats upp!",
"attachments": "Bilagor",
"gpx_tip": "Ladda upp GPX-filer till bilagor för att se dem på kartan!",
"images": "Bilder",
"primary": "Primär",
"upload": "Ladda upp",
"view_attachment": "Visa bilaga"
}, },
"home": { "home": {
"desc_1": "Upptäck, planera och utforska med lätthet", "desc_1": "Upptäck, planera och utforska med lätthet",

View file

@ -221,7 +221,20 @@
"cities_updated": "城市已更新", "cities_updated": "城市已更新",
"create_adventure": "创造冒险", "create_adventure": "创造冒险",
"no_adventures_to_recommendations": "没有发现任何冒险。\n至少添加一次冒险以获得推荐。", "no_adventures_to_recommendations": "没有发现任何冒险。\n至少添加一次冒险以获得推荐。",
"finding_recommendations": "为您的下一次冒险发现隐藏的宝石" "finding_recommendations": "为您的下一次冒险发现隐藏的宝石",
"attachment": "依恋",
"attachment_delete_success": "附件删除成功!",
"attachment_name": "附件名称",
"attachment_update_error": "更新附件时出错",
"attachment_update_success": "附件更新成功!",
"attachment_upload_error": "上传附件时出错",
"attachment_upload_success": "附件上传成功!",
"attachments": "附件",
"gpx_tip": "将 GPX 文件上传到附件即可在地图上查看!",
"images": "图片",
"primary": "基本的",
"upload": "上传",
"view_attachment": "查看附件"
}, },
"home": { "home": {
"desc_1": "轻松发现、规划和探索", "desc_1": "轻松发现、规划和探索",

View file

@ -11,6 +11,8 @@
// @ts-ignore // @ts-ignore
import toGeoJSON from '@mapbox/togeojson'; import toGeoJSON from '@mapbox/togeojson';
import LightbulbOn from '~icons/mdi/lightbulb-on';
let geojson: any; let geojson: any;
const renderMarkdown = (markdown: string) => { const renderMarkdown = (markdown: string) => {
@ -447,7 +449,15 @@
{#if adventure.attachments && adventure.attachments.length > 0} {#if adventure.attachments && adventure.attachments.length > 0}
<div> <div>
<!-- attachments --> <!-- attachments -->
<h2 class="text-2xl font-bold mt-4">{$t('adventures.attachments')}</h2> <h2 class="text-2xl font-bold mt-4">
{$t('adventures.attachments')}
<div class="tooltip z-10" data-tip={$t('adventures.gpx_tip')}>
<button class="btn btn-sm btn-circle btn-neutral">
<LightbulbOn class="w-6 h-6" />
</button>
</div>
</h2>
<div class="grid gap-4 mt-4"> <div class="grid gap-4 mt-4">
{#if adventure.attachments && adventure.attachments.length > 0} {#if adventure.attachments && adventure.attachments.length > 0}
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> <div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">

View file

@ -42,7 +42,7 @@
<h2 class="text-3xl font-bold text-center m-4">Adventures</h2> <h2 class="text-3xl font-bold text-center m-4">Adventures</h2>
<div class="flex flex-wrap gap-4 mr-4 ml-4 justify-center content-center"> <div class="flex flex-wrap gap-4 mr-4 ml-4 justify-center content-center">
{#each adventures as adventure} {#each adventures as adventure}
<AdventureCard {adventure} user={data.user} /> <AdventureCard {adventure} user={null} />
{/each} {/each}
</div> </div>
{/if} {/if}
@ -97,3 +97,8 @@
{$t('adventures.no_results')} {$t('adventures.no_results')}
</p> </p>
{/if} {/if}
<svelte:head>
<title>Search: {query}</title>
<meta name="description" content="AdventureLog global search results for {query}" />
</svelte:head>