|
@@ -26,6 +26,7 @@
|
|
|
import { AppRoute } from '$lib/constants';
|
|
|
import ChangeLocation from '../shared-components/change-location.svelte';
|
|
|
import { handleError } from '../../utils/handle-error';
|
|
|
+ import { user } from '$lib/stores/user.store';
|
|
|
|
|
|
export let asset: AssetResponseDto;
|
|
|
export let albums: AlbumResponseDto[] = [];
|
|
@@ -238,12 +239,14 @@
|
|
|
zone: asset.exifInfo.timeZone ?? undefined,
|
|
|
})}
|
|
|
<div
|
|
|
- class="flex justify-between place-items-start gap-4 py-4 hover:dark:text-immich-dark-primary hover:text-immich-primary cursor-pointer"
|
|
|
- on:click={() => (isShowChangeDate = true)}
|
|
|
- on:keydown={(event) => event.key === 'Enter' && (isShowChangeDate = true)}
|
|
|
+ class="flex justify-between place-items-start gap-4 py-4"
|
|
|
tabindex="0"
|
|
|
role="button"
|
|
|
- title="Edit date"
|
|
|
+ on:click={() => (isOwner ? (isShowChangeDate = true) : null)}
|
|
|
+ on:keydown={(event) => (isOwner ? event.key === 'Enter' && (isShowChangeDate = true) : null)}
|
|
|
+ title={isOwner ? 'Edit date' : ''}
|
|
|
+ class:hover:dark:text-immich-dark-primary={isOwner}
|
|
|
+ class:hover:text-immich-primary={isOwner}
|
|
|
>
|
|
|
<div class="flex gap-4">
|
|
|
<div>
|
|
@@ -276,11 +279,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <button class="focus:outline-none">
|
|
|
- <Icon path={mdiPencil} size="20" />
|
|
|
- </button>
|
|
|
+
|
|
|
+ {#if isOwner}
|
|
|
+ <button class="focus:outline-none">
|
|
|
+ <Icon path={mdiPencil} size="20" />
|
|
|
+ </button>
|
|
|
+ {/if}
|
|
|
</div>
|
|
|
- {:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly}
|
|
|
+ {:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly && $user && asset.ownerId === $user.id}
|
|
|
<div class="flex justify-between place-items-start gap-4 py-4">
|
|
|
<div class="flex gap-4">
|
|
|
<div>
|
|
@@ -410,12 +416,14 @@
|
|
|
|
|
|
{#if asset.exifInfo?.city && !asset.isReadOnly}
|
|
|
<div
|
|
|
- class="flex justify-between place-items-start gap-4 py-4 hover:dark:text-immich-dark-primary hover:text-immich-primary cursor-pointer"
|
|
|
- on:click={() => (isShowChangeLocation = true)}
|
|
|
- on:keydown={(event) => event.key === 'Enter' && (isShowChangeLocation = true)}
|
|
|
+ class="flex justify-between place-items-start gap-4 py-4"
|
|
|
+ on:click={() => (isOwner ? (isShowChangeLocation = true) : null)}
|
|
|
+ on:keydown={(event) => (isOwner ? event.key === 'Enter' && (isShowChangeLocation = true) : null)}
|
|
|
tabindex="0"
|
|
|
+ title={isOwner ? 'Edit location' : ''}
|
|
|
role="button"
|
|
|
- title="Edit location"
|
|
|
+ class:hover:dark:text-immich-dark-primary={isOwner}
|
|
|
+ class:hover:text-immich-primary={isOwner}
|
|
|
>
|
|
|
<div class="flex gap-4">
|
|
|
<div><Icon path={mdiMapMarkerOutline} size="24" /></div>
|
|
@@ -435,11 +443,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div>
|
|
|
- <Icon path={mdiPencil} size="20" />
|
|
|
- </div>
|
|
|
+ {#if isOwner}
|
|
|
+ <div>
|
|
|
+ <Icon path={mdiPencil} size="20" />
|
|
|
+ </div>
|
|
|
+ {/if}
|
|
|
</div>
|
|
|
- {:else if !asset.exifInfo?.city && !asset.isReadOnly}
|
|
|
+ {:else if !asset.exifInfo?.city && !asset.isReadOnly && $user && asset.ownerId === $user.id}
|
|
|
<div
|
|
|
class="flex justify-between place-items-start gap-4 py-4 rounded-lg pr-2 hover:dark:text-immich-dark-primary hover:text-immich-primary"
|
|
|
on:click={() => (isShowChangeLocation = true)}
|