💄 Trip multi-users: add creator to place

This commit is contained in:
itskovacs 2025-08-20 18:16:13 +02:00
parent 83427c9447
commit 7f44896ddb
3 changed files with 9 additions and 2 deletions

View File

@ -221,11 +221,13 @@ class PlaceRead(PlaceBase):
category: CategoryRead
image: str | None
image_id: int | None
user: str
@classmethod
def serialize(cls, obj: Place, exclude_gpx=True) -> "PlaceRead":
return cls(
id=obj.id,
user=obj.user,
name=obj.name,
lat=obj.lat,
lng=obj.lng,

View File

@ -387,8 +387,8 @@
<div class="flex gap-0.5">
<span [style.color]="p.category.color" [style.background-color]="p.category.color + '1A'"
class="text-xs font-medium me-2 px-2.5 py-0.5 rounded flex gap-2 items-center truncate"><i
class="pi pi-box text-xs"></i>{{ p.category.name }}</span>
class="text-xs font-medium me-2 px-2.5 py-0.5 rounded flex gap-2 items-center max-w-28"><i
class="pi pi-box text-xs"></i> <span class="truncate">{{ p.category.name }}</span></span>
@if (isPlaceUsed(p.id)) {
<span class="bg-green-100 text-green-800 text-sm me-2 px-2.5 py-0.5 rounded dark:bg-green-100/85"><i
@ -403,6 +403,10 @@
p.price || '-'
}} {{ currency$ | async }}</span>
@if (trip?.collaborators?.length) {
<span class="bg-gray-100 text-gray-800 text-sm me-2 px-2.5 py-0.5 rounded dark:bg-gray-100/85">{{ p.user
}}</span>
}
</div>
</div>
</div>

View File

@ -15,6 +15,7 @@ export interface Place {
category: Category;
category_id?: number;
user?: string;
gpx?: string;
image?: string;
price?: number;