From 01e4f428b3d73d98dd42a66a7cb96ccd9dc0c06d Mon Sep 17 00:00:00 2001 From: yannfrendo Date: Wed, 29 Nov 2023 11:23:46 +0100 Subject: [PATCH] Don't diplay modify for readOnly asset --- .../asset-viewer/detail-panel.svelte | 77 +++++++++++++++---- 1 file changed, 64 insertions(+), 13 deletions(-) diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 8e085fc471..9146a8b91b 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -233,7 +233,7 @@

DETAILS

{/if} - {#if asset.exifInfo?.dateTimeOriginal} + {#if asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly} {@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, { zone: asset.exifInfo.timeZone ?? undefined, })} @@ -280,26 +280,56 @@ - {:else} + {:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly}
(isShowChangeDate = true)} - on:keydown={(event) => event.key === 'Enter' && (isShowChangeDate = true)} - tabindex="0" - role="button" - title="Add date" - > + class="flex justify-between place-items-start gap-4 py-4">
- -

Add a date

+ {:else if asset.exifInfo?.dateTimeOriginal && asset.isReadOnly} + {@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, { + zone: asset.exifInfo.timeZone ?? undefined, + })} +
+
+
+ +
+ +
+

+ {assetDateTimeOriginal.toLocaleString( + { + month: 'short', + day: 'numeric', + year: 'numeric', + }, + { locale: $locale }, + )} +

+
+

+ {assetDateTimeOriginal.toLocaleString( + { + weekday: 'short', + hour: 'numeric', + minute: '2-digit', + timeZoneName: 'longOffset', + }, + { locale: $locale }, + )} +

+
+
+
+
+ {/if} {#if isShowChangeDate} @@ -380,7 +410,7 @@ {/if} - {#if asset.exifInfo?.city} + {#if asset.exifInfo?.city && !asset.isReadOnly}
(isShowChangeLocation = true)} @@ -411,7 +441,7 @@
- {:else} + {:else if !asset.exifInfo?.city && !asset.isReadOnly}
(isShowChangeLocation = true)} @@ -431,6 +461,27 @@
+ {:else if asset.exifInfo?.city && asset.isReadOnly} +
+
+
+ +
+

{asset.exifInfo.city}

+ {#if asset.exifInfo?.state} +
+

{asset.exifInfo.state}

+
+ {/if} + {#if asset.exifInfo?.country} +
+

{asset.exifInfo.country}

+
+ {/if} +
+
+
{/if} {#if isShowChangeLocation}