You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-30 05:29:30 +02:00
feat(web): show original uploader in shared album photo details (#3977)
* feat(web): show original uploader in shared album photo details * feat: send owner in asset by id response * chore: open api * fix: linting * fix: change to Shared By * openapi * openapi * api * styling --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
import { asByteUnitString } from '../../utils/byte-units';
|
||||
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
|
||||
import { getAssetFilename } from '$lib/utils/asset-utils';
|
||||
import UserAvatar from '../shared-components/user-avatar.svelte';
|
||||
|
||||
export let asset: AssetResponseDto;
|
||||
export let albums: AlbumResponseDto[] = [];
|
||||
@ -20,6 +21,8 @@
|
||||
let textarea: HTMLTextAreaElement;
|
||||
let description: string;
|
||||
|
||||
$: isOwner = $page?.data?.user?.id === asset.ownerId;
|
||||
|
||||
$: {
|
||||
// Get latest description from server
|
||||
if (asset.id && !api.isSharedLink) {
|
||||
@ -93,20 +96,17 @@
|
||||
<p class="text-lg text-immich-fg dark:text-immich-dark-fg">Info</p>
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="mx-4 mt-10"
|
||||
style:display={$page?.data?.user?.id !== asset.ownerId && textarea?.value == '' ? 'none' : 'block'}
|
||||
>
|
||||
<section class="mx-4 mt-10" style:display={!isOwner && textarea?.value == '' ? 'none' : 'block'}>
|
||||
<textarea
|
||||
bind:this={textarea}
|
||||
class="max-h-[500px]
|
||||
w-full resize-none overflow-hidden border-b border-gray-500 bg-transparent text-base text-black outline-none transition-all focus:border-b-2 focus:border-immich-primary disabled:border-none dark:text-white dark:focus:border-immich-dark-primary"
|
||||
placeholder={$page?.data?.user?.id !== asset.ownerId ? '' : 'Add a description'}
|
||||
placeholder={!isOwner ? '' : 'Add a description'}
|
||||
on:focusin={handleFocusIn}
|
||||
on:focusout={handleFocusOut}
|
||||
on:input={autoGrowHeight}
|
||||
bind:value={description}
|
||||
disabled={$page?.data?.user?.id !== asset.ownerId}
|
||||
disabled={!isOwner}
|
||||
/>
|
||||
</section>
|
||||
|
||||
@ -291,11 +291,27 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<section class="p-2 dark:text-immich-dark-fg">
|
||||
<div class="px-4 py-4">
|
||||
{#if albums.length > 0}
|
||||
<p class="pb-4 text-sm">APPEARS IN</p>
|
||||
{/if}
|
||||
{#if asset.owner && !isOwner}
|
||||
<section class="px-6 pt-6 dark:text-immich-dark-fg">
|
||||
<p class="text-sm">SHARED BY</p>
|
||||
<div class="flex gap-4 pt-4">
|
||||
<div>
|
||||
<UserAvatar user={asset.owner} size="md" autoColor />
|
||||
</div>
|
||||
|
||||
<div class="mb-auto mt-auto">
|
||||
<p>
|
||||
{asset.owner.firstName}
|
||||
{asset.owner.lastName}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if albums.length > 0}
|
||||
<section class="p-6 dark:text-immich-dark-fg">
|
||||
<p class="pb-4 text-sm">APPEARS IN</p>
|
||||
{#each albums as album}
|
||||
<a data-sveltekit-preload-data="hover" href={`/albums/${album.id}`}>
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
@ -326,5 +342,5 @@
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
{/if}
|
||||
|
Reference in New Issue
Block a user