Skip to content

Commit 1e107bd

Browse files
committed
chore(concierge): tweak styling of signage display playlists
1 parent 1f380d0 commit 1e107bd

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

apps/concierge/src/app/signage/signage-item-playlists.component.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DragDropModule } from '@angular/cdk/drag-drop';
2-
import { CommonModule } from '@angular/common';
2+
import { CommonModule, SlicePipe } from '@angular/common';
33
import {
44
Component,
55
OnChanges,
@@ -15,6 +15,7 @@ import { toSignal } from '@angular/core/rxjs-interop';
1515
import { MatRippleModule } from '@angular/material/core';
1616
import { MatMenuModule } from '@angular/material/menu';
1717
import { MatTooltipModule } from '@angular/material/tooltip';
18+
import { RouterLink } from '@angular/router';
1819
import { IconComponent, TranslatePipe } from '@placeos/components';
1920
import { SignagePlaylist } from '@placeos/ts-client';
2021
import { SignageStateService } from './signage-state.service';
@@ -25,6 +26,7 @@ interface PlaylistCount {
2526
}
2627

2728
const PLAYLIST_ITEM_COUNTS = signal<Record<string, PlaylistCount>>({});
29+
const PLAYLIST_ITEM_THUMBNAILS = signal<Record<string, string[]>>({});
2830

2931
@Component({
3032
selector: `signage-item-playlists`,
@@ -85,6 +87,28 @@ const PLAYLIST_ITEM_COUNTS = signal<Record<string, PlaylistCount>>({});
8587
>
8688
<icon>drag_handle</icon>
8789
</button>
90+
<a
91+
preview
92+
matRipple
93+
[routerLink]="['/signage', 'media']"
94+
[queryParams]="{ playlist: item.id }"
95+
class="h-14 w-14 overflow-hidden rounded border border-base-200 bg-base-200"
96+
>
97+
@for (
98+
media of playlist_thumbnails()[item.id] || []
99+
| slice: 0 : 2;
100+
track media;
101+
let i = $index
102+
) {
103+
<img
104+
auth
105+
[source]="media"
106+
class="absolute h-full w-full rounded object-cover shadow-lg"
107+
[style.top]="0.5 + i * 1 + 'rem'"
108+
[style.left]="0.5 + i * 1 + 'rem'"
109+
/>
110+
}
111+
</a>
88112
<div class="w-1/2 flex-1 text-base-content">
89113
<div class="truncate">
90114
{{ item.name }}
@@ -98,12 +122,14 @@ const PLAYLIST_ITEM_COUNTS = signal<Record<string, PlaylistCount>>({});
98122
playlist_count()[item.id]
99123
?.count || 0,
100124
}
125+
: playlist_count()[item.id]
126+
?.count || 0
101127
}}
102128
</div>
103129
</div>
104130
@if (isScheduled(item)) {
105131
<div
106-
class="rounded border border-info bg-base-100 bg-info-light p-1 text-lg"
132+
class="rounded border border-info bg-info-light p-1 text-lg"
107133
[matTooltip]="'COMMON.SCHEDULED' | translate"
108134
>
109135
<icon>event</icon>
@@ -205,6 +231,8 @@ const PLAYLIST_ITEM_COUNTS = signal<Record<string, PlaylistCount>>({});
205231
MatMenuModule,
206232
DragDropModule,
207233
MatTooltipModule,
234+
RouterLink,
235+
SlicePipe,
208236
],
209237
})
210238
export class SignageItemPlaylistsComponent implements OnChanges {
@@ -244,6 +272,10 @@ export class SignageItemPlaylistsComponent implements OnChanges {
244272
};
245273
return m;
246274
});
275+
this.playlist_thumbnails.update((m) => {
276+
m[item.id] = media;
277+
return m;
278+
});
247279
});
248280
}
249281
});
@@ -265,6 +297,7 @@ export class SignageItemPlaylistsComponent implements OnChanges {
265297
}
266298

267299
public readonly playlist_count = PLAYLIST_ITEM_COUNTS;
300+
public readonly playlist_thumbnails = PLAYLIST_ITEM_THUMBNAILS;
268301

269302
public playlistCount(id: string) {
270303
return PLAYLIST_ITEM_COUNTS()[id]?.count || 0;

shared/assets/locale/en-AU.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,8 @@
16101610
"SIGNAGE_MEDIA_UPLOAD": "Upload Media",
16111611
"SIGNAGE_MEDIA_LINK": "Add Media from URL",
16121612
"SIGNAGE_MEDIA_ALL": "All Media",
1613-
"SIGNAGE_MEDIA_COUNT": "{{ count }} media item(s)",
1613+
"SIGNAGE_MEDIA_COUNT": "{{ count }} playlist items",
1614+
"SIGNAGE_MEDIA_COUNT_1": "{{ count }} playlist item",
16141615
"SIGNAGE_MEDIA_SAVING": "Saving media item...",
16151616
"SIGNAGE_MEDIA_SAVE": "Save Media",
16161617
"SIGNAGE_MEDIA_FILE_ERROR": "Invalid file type",

shared/assets/locale/en-GB.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,8 @@
15831583
"SIGNAGE_MEDIA_UPLOAD": "Upload Media",
15841584
"SIGNAGE_MEDIA_LINK": "Add Media from URL",
15851585
"SIGNAGE_MEDIA_ALL": "All Media",
1586-
"SIGNAGE_MEDIA_COUNT": "{{ count }} media item(s)",
1586+
"SIGNAGE_MEDIA_COUNT": "{{ count }} playlist items",
1587+
"SIGNAGE_MEDIA_COUNT_1": "{{ count }} playlist item",
15871588
"SIGNAGE_MEDIA_SAVING": "Saving media item...",
15881589
"SIGNAGE_MEDIA_SAVE": "Save Media",
15891590
"SIGNAGE_MEDIA_FILE_ERROR": "Invalid file type",

shared/assets/locale/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,8 @@
15831583
"SIGNAGE_MEDIA_UPLOAD": "Upload Media",
15841584
"SIGNAGE_MEDIA_LINK": "Add Media from URL",
15851585
"SIGNAGE_MEDIA_ALL": "All Media",
1586-
"SIGNAGE_MEDIA_COUNT": "{{ count }} media item(s)",
1586+
"SIGNAGE_MEDIA_COUNT": "{{ count }} playlist items",
1587+
"SIGNAGE_MEDIA_COUNT_1": "{{ count }} playlist item",
15871588
"SIGNAGE_MEDIA_SAVING": "Saving media item...",
15881589
"SIGNAGE_MEDIA_SAVE": "Save Media",
15891590
"SIGNAGE_MEDIA_FILE_ERROR": "Invalid file type",

0 commit comments

Comments
 (0)