mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 12:19:05 +00:00
format
This commit is contained in:
@@ -29,15 +29,18 @@
|
||||
export let data: PageData;
|
||||
|
||||
const sortByOptions = ['Most recent photo', 'Last modified', 'Album title'];
|
||||
const viewOptions = [{
|
||||
name: AlbumViewMode.Cover,
|
||||
icon: ViewGridOutline
|
||||
}, {
|
||||
name: AlbumViewMode.List,
|
||||
icon: FormatListBulletedSquare
|
||||
}]
|
||||
const viewOptionNames = viewOptions.map(option => option.name)
|
||||
const viewOptionIcons = viewOptions.map(option => option.icon)
|
||||
const viewOptions = [
|
||||
{
|
||||
name: AlbumViewMode.Cover,
|
||||
icon: ViewGridOutline,
|
||||
},
|
||||
{
|
||||
name: AlbumViewMode.List,
|
||||
icon: FormatListBulletedSquare,
|
||||
},
|
||||
];
|
||||
const viewOptionNames = viewOptions.map((option) => option.name);
|
||||
const viewOptionIcons = viewOptions.map((option) => option.icon);
|
||||
|
||||
const {
|
||||
albums: unsortedAlbums,
|
||||
@@ -103,8 +106,8 @@
|
||||
};
|
||||
|
||||
const dateLocaleString = (dateString: string) => {
|
||||
return new Date(dateString).toLocaleDateString($locale, dateFormats.album)
|
||||
}
|
||||
return new Date(dateString).toLocaleDateString($locale, dateFormats.album);
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
removeAlbumsIfEmpty();
|
||||
@@ -162,18 +165,18 @@
|
||||
>
|
||||
{#each $albums as album (album.id)}
|
||||
<tr
|
||||
class="flex h-[50px] w-full place-items-center text-center odd:bg-immich-gray even:bg-immich-bg odd:dark:bg-immich-dark-gray/75 even:dark:bg-immich-dark-gray/50 border-[3px] border-transparent p-5 hover:cursor-pointer hover:border-immich-primary/75 dark:hover:border-immich-dark-primary/75"
|
||||
class="flex h-[50px] w-full place-items-center border-[3px] border-transparent p-5 text-center odd:bg-immich-gray even:bg-immich-bg hover:cursor-pointer hover:border-immich-primary/75 odd:dark:bg-immich-dark-gray/75 even:dark:bg-immich-dark-gray/50 dark:hover:border-immich-dark-primary/75"
|
||||
on:click={() => goto(`albums/${album.id}`)}
|
||||
on:keydown={(event) => event.key === 'Enter' && goto(`albums/${album.id}`)}
|
||||
tabindex="0"
|
||||
>
|
||||
<td class="w-1/4 text-ellipsis px-2 text-md">{album.albumName}</td>
|
||||
<td class="w-1/4 text-ellipsis px-2 text-md">
|
||||
{album.assetCount}
|
||||
{album.assetCount == 1 ? `item` : `items`}
|
||||
<td class="text-md w-1/4 text-ellipsis px-2">{album.albumName}</td>
|
||||
<td class="text-md w-1/4 text-ellipsis px-2">
|
||||
{album.assetCount}
|
||||
{album.assetCount == 1 ? `item` : `items`}
|
||||
</td>
|
||||
<td class="w-1/4 text-ellipsis px-2 text-md">{dateLocaleString(album.updatedAt)}</td>
|
||||
<td class="w-1/4 text-ellipsis px-2 text-md">{dateLocaleString(album.createdAt)}</td>
|
||||
<td class="text-md w-1/4 text-ellipsis px-2">{dateLocaleString(album.updatedAt)}</td>
|
||||
<td class="text-md w-1/4 text-ellipsis px-2">{dateLocaleString(album.createdAt)}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user