Refactor code structure for improved readability and maintainability

This commit is contained in:
Sean Morley
2025-12-28 17:25:59 -05:00
parent 8a9d78715e
commit 52712bfbbf
5 changed files with 1087 additions and 1084 deletions

View File

@@ -38,18 +38,18 @@ class CollectionViewSet(viewsets.ModelViewSet):
if order_by == 'name':
queryset = queryset.annotate(lower_name=Lower('name'))
ordering = 'lower_name'
if order_direction == 'desc':
if order_direction == 'asc':
ordering = f'-{ordering}'
elif order_by == 'start_date':
ordering = 'start_date'
if order_direction == 'asc':
if order_direction == 'desc':
ordering = 'start_date'
else:
ordering = '-start_date'
else:
order_by == 'updated_at'
ordering = 'updated_at'
if order_direction == 'asc':
if order_direction == 'desc':
ordering = '-updated_at'
return queryset.order_by(ordering)

View File

@@ -229,7 +229,7 @@
</div>
<div>
<h1 class="text-3xl font-bold text-primary bg-clip-text">
{$t('adventures.my_adventures')}
{$t('adventures.my_locations')}
</h1>
<p class="text-sm text-base-content/60">
{filteredPins.length}
@@ -339,9 +339,9 @@
<div class="p-6 bg-base-200/50 rounded-2xl mb-6">
<span class="loading loading-spinner w-16 h-16 text-primary"></span>
</div>
<h3 class="text-xl font-semibold text-base-content/70 mb-2">
{$t('adventures.loading_adventures')}
</h3>
<!-- <h3 class="text-xl font-semibold text-base-content/70 mb-2">
{$t('immich.loading')}
</h3> -->
</div>
{:else}
<!-- Main Content -->
@@ -364,10 +364,10 @@
</button>
{:else}
<h3 class="text-xl font-semibold text-base-content/70 mb-2">
{$t('adventures.no_linkable_adventures')}
{$t('adventures.no_linkable_locations')}
</h3>
<p class="text-base-content/50 text-center max-w-md">
{$t('adventures.all_adventures_already_linked')}
{$t('adventures.all_locations_already_linked')}
</p>
{/if}
</div>
@@ -406,7 +406,7 @@
<div class="flex items-center justify-between">
<div class="text-sm text-base-content/60">
{filteredPins.length}
{$t('adventures.adventures_available')}
{$t('locations.locations')}
</div>
<button class="btn btn-primary gap-2" on:click={close}>
<Link class="w-4 h-4" />

View File

@@ -51,7 +51,7 @@
</div>
</div>
<div class="px-2 max-h-[28rem] overflow-y-auto space-y-3">
<div class="px-2 max-h-[28rem] overflow-y-auto space-y-3 pt-4 pb-4">
{#if days.length === 0}
<div class="card bg-base-200 border border-base-300">
<div class="card-body text-center py-10">

View File

@@ -1,4 +1,4 @@
export let appVersion = 'v0.12.0-pre-dev-122725';
export let appVersion = 'v0.12.0-pre-dev-122825';
export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.11.0';
export let appTitle = 'AdventureLog';
export let copyrightYear = '2023-2025';

View File

File diff suppressed because it is too large Load Diff