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

Add default category icon and improve visit display:

- Set default icon for empty category in AdventureModal
- Enhance layout for visit buttons and validation messages in DateRangeCollapse
- Update localization files to include "no visits" strings in multiple languages
This commit is contained in:
Sean Morley 2025-05-09 21:17:11 -04:00
parent 3caebd37dd
commit 04f9227ae6
13 changed files with 157 additions and 125 deletions

View file

@ -463,6 +463,13 @@
event.preventDefault();
triggerMarkVisted = true;
// if category icon is empty, set it to the default icon
if (adventure.category?.icon == '' || adventure.category?.icon == null) {
if (adventure.category) {
adventure.category.icon = '🌍';
}
}
if (adventure.id === '') {
if (adventure.category?.display_name == '') {
if (categories.some((category) => category.name === 'general')) {
@ -479,6 +486,7 @@
};
}
}
let res = await fetch('/api/adventures', {
method: 'POST',
headers: {
@ -708,8 +716,10 @@
<span>{$t('adventures.warning')}: {warningMessage}</span>
</div>
{/if}
<button type="submit" class="btn btn-primary">{$t('adventures.save_next')}</button>
<button type="button" class="btn" on:click={close}>{$t('about.close')}</button>
<div class="flex flex-row gap-2">
<button type="submit" class="btn btn-primary">{$t('adventures.save_next')}</button>
<button type="button" class="btn" on:click={close}>{$t('about.close')}</button>
</div>
</div>
</div>
</form>