mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 12:26:47 +01:00
fix(web): correctly use button and link elements (#7907)
This commit is contained in:
parent
67b209808f
commit
b07ed3f615
2 changed files with 64 additions and 81 deletions
|
@ -258,18 +258,15 @@
|
||||||
<div class="mt-2 flex flex-wrap gap-2">
|
<div class="mt-2 flex flex-wrap gap-2">
|
||||||
{#each people as person, index (person.id)}
|
{#each people as person, index (person.id)}
|
||||||
{#if showingHiddenPeople || !person.isHidden}
|
{#if showingHiddenPeople || !person.isHidden}
|
||||||
<div
|
|
||||||
class="w-[90px]"
|
|
||||||
role="button"
|
|
||||||
tabindex={index}
|
|
||||||
on:focus={() => ($boundingBoxesArray = people[index].faces)}
|
|
||||||
on:mouseover={() => ($boundingBoxesArray = people[index].faces)}
|
|
||||||
on:mouseleave={() => ($boundingBoxesArray = [])}
|
|
||||||
>
|
|
||||||
<a
|
<a
|
||||||
|
class="w-[90px]"
|
||||||
href="{AppRoute.PEOPLE}/{person.id}?{QueryParameter.PREVIOUS_ROUTE}={currentAlbum?.id
|
href="{AppRoute.PEOPLE}/{person.id}?{QueryParameter.PREVIOUS_ROUTE}={currentAlbum?.id
|
||||||
? `${AppRoute.ALBUMS}/${currentAlbum?.id}`
|
? `${AppRoute.ALBUMS}/${currentAlbum?.id}`
|
||||||
: AppRoute.PHOTOS}"
|
: AppRoute.PHOTOS}"
|
||||||
|
on:focus={() => ($boundingBoxesArray = people[index].faces)}
|
||||||
|
on:blur={() => ($boundingBoxesArray = [])}
|
||||||
|
on:mouseover={() => ($boundingBoxesArray = people[index].faces)}
|
||||||
|
on:mouseleave={() => ($boundingBoxesArray = [])}
|
||||||
on:click={() => dispatch('closeViewer')}
|
on:click={() => dispatch('closeViewer')}
|
||||||
>
|
>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
|
@ -313,7 +310,6 @@
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
@ -341,12 +337,10 @@
|
||||||
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
|
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
|
||||||
zone: asset.exifInfo.timeZone ?? undefined,
|
zone: asset.exifInfo.timeZone ?? undefined,
|
||||||
})}
|
})}
|
||||||
<div
|
<button
|
||||||
class="flex justify-between place-items-start gap-4 py-4"
|
type="button"
|
||||||
tabindex="0"
|
class="flex w-full text-left justify-between place-items-start gap-4 py-4"
|
||||||
role="button"
|
|
||||||
on:click={() => (isOwner ? (isShowChangeDate = true) : null)}
|
on:click={() => (isOwner ? (isShowChangeDate = true) : null)}
|
||||||
on:keydown={(event) => (isOwner ? event.key === 'Enter' && (isShowChangeDate = true) : null)}
|
|
||||||
title={isOwner ? 'Edit date' : ''}
|
title={isOwner ? 'Edit date' : ''}
|
||||||
class:hover:dark:text-immich-dark-primary={isOwner}
|
class:hover:dark:text-immich-dark-primary={isOwner}
|
||||||
class:hover:text-immich-primary={isOwner}
|
class:hover:text-immich-primary={isOwner}
|
||||||
|
@ -384,11 +378,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if isOwner}
|
{#if isOwner}
|
||||||
<button class="focus:outline-none p-1">
|
<div class="p-1">
|
||||||
<Icon path={mdiPencil} size="20" />
|
<Icon path={mdiPencil} size="20" />
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
{:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly && isOwner}
|
{:else if !asset.exifInfo?.dateTimeOriginal && !asset.isReadOnly && isOwner}
|
||||||
<div class="flex justify-between place-items-start gap-4 py-4">
|
<div class="flex justify-between place-items-start gap-4 py-4">
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
|
@ -396,9 +390,9 @@
|
||||||
<Icon path={mdiCalendar} size="24" />
|
<Icon path={mdiCalendar} size="24" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="focus:outline-none p-1">
|
<div class="p-1">
|
||||||
<Icon path={mdiPencil} size="20" />
|
<Icon path={mdiPencil} size="20" />
|
||||||
</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else if asset.exifInfo?.dateTimeOriginal && asset.isReadOnly}
|
{:else if asset.exifInfo?.dateTimeOriginal && asset.isReadOnly}
|
||||||
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
|
{@const assetDateTimeOriginal = DateTime.fromISO(asset.exifInfo.dateTimeOriginal, {
|
||||||
|
@ -517,13 +511,11 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if asset.exifInfo?.city && !asset.isReadOnly}
|
{#if asset.exifInfo?.city && !asset.isReadOnly}
|
||||||
<div
|
<button
|
||||||
class="flex justify-between place-items-start gap-4 py-4"
|
type="button"
|
||||||
|
class="flex w-full text-left justify-between place-items-start gap-4 py-4"
|
||||||
on:click={() => (isOwner ? (isShowChangeLocation = true) : null)}
|
on:click={() => (isOwner ? (isShowChangeLocation = true) : null)}
|
||||||
on:keydown={(event) => (isOwner ? event.key === 'Enter' && (isShowChangeLocation = true) : null)}
|
|
||||||
tabindex="0"
|
|
||||||
title={isOwner ? 'Edit location' : ''}
|
title={isOwner ? 'Edit location' : ''}
|
||||||
role="button"
|
|
||||||
class:hover:dark:text-immich-dark-primary={isOwner}
|
class:hover:dark:text-immich-dark-primary={isOwner}
|
||||||
class:hover:text-immich-primary={isOwner}
|
class:hover:text-immich-primary={isOwner}
|
||||||
>
|
>
|
||||||
|
@ -550,14 +542,12 @@
|
||||||
<Icon path={mdiPencil} size="20" />
|
<Icon path={mdiPencil} size="20" />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</button>
|
||||||
{:else if !asset.exifInfo?.city && !asset.isReadOnly && isOwner}
|
{:else if !asset.exifInfo?.city && !asset.isReadOnly && isOwner}
|
||||||
<div
|
<button
|
||||||
class="flex justify-between place-items-start gap-4 py-4 rounded-lg hover:dark:text-immich-dark-primary hover:text-immich-primary"
|
type="button"
|
||||||
|
class="flex w-full text-left justify-between place-items-start gap-4 py-4 rounded-lg hover:dark:text-immich-dark-primary hover:text-immich-primary"
|
||||||
on:click={() => (isShowChangeLocation = true)}
|
on:click={() => (isShowChangeLocation = true)}
|
||||||
on:keydown={(event) => event.key === 'Enter' && (isShowChangeLocation = true)}
|
|
||||||
tabindex="0"
|
|
||||||
role="button"
|
|
||||||
title="Add location"
|
title="Add location"
|
||||||
>
|
>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
|
@ -570,7 +560,7 @@
|
||||||
<div class="focus:outline-none p-1">
|
<div class="focus:outline-none p-1">
|
||||||
<Icon path={mdiPencil} size="20" />
|
<Icon path={mdiPencil} size="20" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</button>
|
||||||
{:else if asset.exifInfo?.city && asset.isReadOnly}
|
{:else if asset.exifInfo?.city && asset.isReadOnly}
|
||||||
<div class="flex justify-between place-items-start gap-4 py-4">
|
<div class="flex justify-between place-items-start gap-4 py-4">
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
import Icon from '$lib/components/elements/icon.svelte';
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import { getAssetThumbnailUrl } from '$lib/utils';
|
import { getAssetThumbnailUrl } from '$lib/utils';
|
||||||
|
@ -122,15 +121,9 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !link.expiresAt || !isExpired(link.expiresAt)}
|
{#if !link.expiresAt || !isExpired(link.expiresAt)}
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<a href="{AppRoute.SHARE}/{link.key}" title="Go to share page">
|
||||||
<div
|
|
||||||
class="hover:cursor-pointer"
|
|
||||||
title="Go to share page"
|
|
||||||
on:click={() => goto(`${AppRoute.SHARE}/${link.key}`)}
|
|
||||||
on:keydown={() => goto(`${AppRoute.SHARE}/${link.key}`)}
|
|
||||||
>
|
|
||||||
<Icon path={mdiOpenInNew} />
|
<Icon path={mdiOpenInNew} />
|
||||||
</div>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue