diff --git a/frontend/src/lib/components/CategoryModal.svelte b/frontend/src/lib/components/CategoryModal.svelte index e28706f..f1ce0c4 100644 --- a/frontend/src/lib/components/CategoryModal.svelte +++ b/frontend/src/lib/components/CategoryModal.svelte @@ -1,149 +1,353 @@ - - - - - {$t('categories.manage_categories')} + + + + + + {$t('categories.manage_categories')} + + ✕ + + - {#if has_loaded} - {#each categories as category} - - {category.display_name} {category.icon} - - (category_to_edit = category)} class="btn btn-primary btn-sm" - >Edit - {#if category.name != 'general'} - {$t('adventures.remove')} - {:else} - {$t('adventures.remove')} - {/if} - + + {#if hasLoaded} + {#if categories.length > 0} + + {#each categories as category (category.id)} + + + {category.icon || '🌍'} + {category.display_name} + + + startEdit(category)} + class="btn btn-xs btn-outline" + > + {$t('lodging.edit')} + + {#if category.name !== 'general'} + removeCategory(category)} + class="btn btn-xs btn-error btn-outline" + > + {$t('adventures.remove')} + + {/if} + + + {/each} + + {:else} + + {$t('categories.no_categories_found')} - {/each} - {#if categories.length === 0} - {$t('categories.no_categories_found')} {/if} {:else} - - + + {/if} - {#if category_to_edit} - {$t('categories.edit_category')} - - + + {#if categoryToEdit} + + {$t('categories.edit_category')} + + + + + + {$t('categories.category_name')} + + + + + + + {$t('categories.icon')} + + + + (showEmojiPickerEdit = !showEmojiPickerEdit)} + class="btn btn-square btn-outline" + > + 😀 + + + + - + {#if showEmojiPickerEdit} + + + + {/if} + + + + {$t('adventures.cancel')} + + {$t('notes.save')} + + - {$t('notes.save')} {/if} - {$t('about.close')} + + + + {$t('categories.add_new_category')} + {#if showAddForm} + + + + + + {$t('categories.category_name')} + + + - {#if is_changed} - - - - + + + + {$t('categories.icon')} + + + + (showEmojiPickerAdd = !showEmojiPickerAdd)} + class="btn btn-square btn-outline" + > + 😀 + + + {#if showEmojiPickerAdd} + + + + {/if} + + + + {$t('collection.create')} + + + + {/if} + + + + {#if warningMessage} + + {warningMessage} + + {/if} + + {#if isChanged} + {$t('categories.update_after_refresh')} {/if} + + + + {$t('about.close')} + + + diff --git a/frontend/src/lib/components/Navbar.svelte b/frontend/src/lib/components/Navbar.svelte index b4f6854..ee75fa5 100644 --- a/frontend/src/lib/components/Navbar.svelte +++ b/frontend/src/lib/components/Navbar.svelte @@ -20,13 +20,6 @@ import { onMount } from 'svelte'; let inputElement: HTMLInputElement | null = null; - let isScrolled = false; - - // Handle scroll effect - function handleScroll() { - isScrolled = window.scrollY > 10; - } - let theme = ''; // Event listener for focusing input @@ -44,13 +37,15 @@ } onMount(() => { + // Attach event listener on component mount document.addEventListener('keydown', handleKeydown); - window.addEventListener('scroll', handleScroll); - theme = document.documentElement.getAttribute('data-theme') || ''; + // @ts-ignore + theme = document.documentElement.getAttribute('data-theme'); + + // Cleanup event listener on component destruction return () => { document.removeEventListener('keydown', handleKeydown); - window.removeEventListener('scroll', handleScroll); }; }); @@ -113,11 +108,7 @@ (isAboutModalOpen = false)} /> {/if} - + @@ -199,19 +190,9 @@ {/if} - - - - - - - + + AdventureLog + @@ -274,26 +255,19 @@ {/if} {#if data.user} - - + + - - / - - - - - + bind:this={inputElement} + />/ + + + + {/if} @@ -356,4 +330,4 @@ - + diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e5324b1..8ff6f13 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -630,7 +630,9 @@ "manage_categories": "Kategorien verwalten", "no_categories_found": "Keine Kategorien gefunden.", "select_category": "Kategorie wählen", - "update_after_refresh": "Die Abenteuerkarten werden aktualisiert, sobald Sie die Seite aktualisieren." + "update_after_refresh": "Die Abenteuerkarten werden aktualisiert, sobald Sie die Seite aktualisieren.", + "add_category": "Kategorie hinzufügen", + "add_new_category": "Neue Kategorie hinzufügen" }, "dashboard": { "add_some": "Warum nicht gleich Ihr nächstes Abenteuer planen? Sie können ein neues Abenteuer hinzufügen, indem Sie auf den Button unten klicken.", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 079641d..65b00cf 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -660,7 +660,9 @@ "icon": "Icon", "update_after_refresh": "The adventure cards will be updated once you refresh the page.", "select_category": "Select Category", - "category_name": "Category Name" + "category_name": "Category Name", + "add_category": "Add Category", + "add_new_category": "Add New Category" }, "dashboard": { "welcome_back": "Welcome back", diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index 62c293d..fa01b4c 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -630,7 +630,9 @@ "manage_categories": "Administrar categorías", "no_categories_found": "No se encontraron categorías.", "select_category": "Seleccionar categoría", - "update_after_refresh": "Las tarjetas de aventuras se actualizarán una vez que actualices la página." + "update_after_refresh": "Las tarjetas de aventuras se actualizarán una vez que actualices la página.", + "add_category": "Agregar categoría", + "add_new_category": "Agregar nueva categoría" }, "dashboard": { "add_some": "¿Por qué no empezar a planificar tu próxima aventura? \nPuedes agregar una nueva aventura haciendo clic en el botón de abajo.", diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 57cecab..d2a1aa5 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -630,7 +630,9 @@ "manage_categories": "Gérer les catégories", "no_categories_found": "Aucune catégorie trouvée.", "select_category": "Sélectionnez une catégorie", - "update_after_refresh": "Les cartes d'aventure seront mises à jour une fois que vous aurez actualisé la page." + "update_after_refresh": "Les cartes d'aventure seront mises à jour une fois que vous aurez actualisé la page.", + "add_category": "Ajouter une catégorie", + "add_new_category": "Ajouter une nouvelle catégorie" }, "dashboard": { "add_some": "Pourquoi ne pas commencer à planifier votre prochaine aventure ? \nVous pouvez ajouter une nouvelle aventure en cliquant sur le bouton ci-dessous.", diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json index f894b81..7e876c0 100644 --- a/frontend/src/locales/it.json +++ b/frontend/src/locales/it.json @@ -630,7 +630,9 @@ "manage_categories": "Gestisci categorie", "no_categories_found": "Nessuna categoria trovata.", "select_category": "Seleziona Categoria", - "update_after_refresh": "Le carte avventura verranno aggiornate una volta aggiornata la pagina." + "update_after_refresh": "Le carte avventura verranno aggiornate una volta aggiornata la pagina.", + "add_category": "Aggiungi categoria", + "add_new_category": "Aggiungi nuova categoria" }, "dashboard": { "add_some": "Perché non iniziare a pianificare la tua prossima avventura? \nPuoi aggiungere una nuova avventura facendo clic sul pulsante in basso.", diff --git a/frontend/src/locales/ko.json b/frontend/src/locales/ko.json index 6da6fd1..47bcf4c 100644 --- a/frontend/src/locales/ko.json +++ b/frontend/src/locales/ko.json @@ -307,7 +307,9 @@ "manage_categories": "카테고리 관리", "no_categories_found": "카테고리가 없습니다.", "select_category": "카테고리 선택", - "update_after_refresh": "페이지를 새로고침해야 모험 카드가 업데이트됩니다." + "update_after_refresh": "페이지를 새로고침해야 모험 카드가 업데이트됩니다.", + "add_category": "카테고리 추가", + "add_new_category": "새 카테고리를 추가하십시오" }, "checklist": { "add_item": "항목 추가", diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index 7c5ff5d..cf690ad 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -630,7 +630,9 @@ "manage_categories": "Beheer categorieën", "no_categories_found": "Geen categorieën gevonden.", "select_category": "Selecteer een categorie", - "update_after_refresh": "De avonturenkaarten worden bijgewerkt zodra u de pagina vernieuwt." + "update_after_refresh": "De avonturenkaarten worden bijgewerkt zodra u de pagina vernieuwt.", + "add_category": "Categorie toevoegen", + "add_new_category": "Voeg een nieuwe categorie toe" }, "dashboard": { "add_some": "Waarom begint u niet met het plannen van uw volgende avontuur? \nJe kunt een nieuw avontuur toevoegen door op de onderstaande knop te klikken.", diff --git a/frontend/src/locales/no.json b/frontend/src/locales/no.json index 8d8de76..0806321 100644 --- a/frontend/src/locales/no.json +++ b/frontend/src/locales/no.json @@ -660,7 +660,9 @@ "icon": "Ikon", "update_after_refresh": "Eventyrkortene vil oppdateres når du oppdaterer siden.", "select_category": "Velg kategori", - "category_name": "Kategorinavn" + "category_name": "Kategorinavn", + "add_category": "Legg til kategori", + "add_new_category": "Legg til ny kategori" }, "dashboard": { "welcome_back": "Velkommen tilbake", diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json index 772ed09..d5e0eeb 100644 --- a/frontend/src/locales/pl.json +++ b/frontend/src/locales/pl.json @@ -630,7 +630,9 @@ "icon": "Ikona", "update_after_refresh": "Karty podróży zostaną zaktualizowane po odświeżeniu strony.", "select_category": "Wybierz kategorię", - "category_name": "Nazwa kategorii" + "category_name": "Nazwa kategorii", + "add_category": "Dodaj kategorię", + "add_new_category": "Dodaj nową kategorię" }, "dashboard": { "add_some": "Dlaczego nie zacząć planować kolejnej przygody? \nMożesz dodać nową przygodę, klikając przycisk poniżej.", diff --git a/frontend/src/locales/sv.json b/frontend/src/locales/sv.json index aa98ec9..d3388e8 100644 --- a/frontend/src/locales/sv.json +++ b/frontend/src/locales/sv.json @@ -630,7 +630,9 @@ "manage_categories": "Hantera kategorier", "no_categories_found": "Inga kategorier hittades.", "select_category": "Välj Kategori", - "update_after_refresh": "Äventyrskorten kommer att uppdateras när du uppdaterar sidan." + "update_after_refresh": "Äventyrskorten kommer att uppdateras när du uppdaterar sidan.", + "add_category": "Lägg till kategori", + "add_new_category": "Lägg till en ny kategori" }, "dashboard": { "add_some": "Varför inte börja planera ditt nästa äventyr? \nDu kan lägga till ett nytt äventyr genom att klicka på knappen nedan.", diff --git a/frontend/src/locales/zh.json b/frontend/src/locales/zh.json index 48fbb2b..8da865c 100644 --- a/frontend/src/locales/zh.json +++ b/frontend/src/locales/zh.json @@ -630,7 +630,9 @@ "manage_categories": "管理类别", "no_categories_found": "未找到类别。", "select_category": "选择类别", - "update_after_refresh": "刷新页面后,冒险卡将更新。" + "update_after_refresh": "刷新页面后,冒险卡将更新。", + "add_category": "添加类别", + "add_new_category": "添加新类别" }, "dashboard": { "add_some": "为什么不开始计划你的下一次冒险呢?\n您可以通过单击下面的按钮添加新的冒险。",
{$t('categories.no_categories_found')}