+
+
-
+
+
diff --git a/web/src/lib/modals/SharedLinkCreateModal.svelte b/web/src/lib/modals/SharedLinkCreateModal.svelte
new file mode 100644
index 00000000000..b4b9eaf98f2
--- /dev/null
+++ b/web/src/lib/modals/SharedLinkCreateModal.svelte
@@ -0,0 +1,235 @@
+
+
+
+
+ {#if shareType === SharedLinkType.Album}
+ {#if !editingLink}
+ {$t('album_with_link_access')}
+ {:else}
+
+ {$t('public_album')} |
+ {editingLink.album?.albumName}
+
+ {/if}
+ {/if}
+
+ {#if shareType === SharedLinkType.Individual}
+ {#if !editingLink}
+ {$t('create_link_to_share_description')}
+ {:else}
+
+ {$t('individual_share')} |
+ {editingLink.description || ''}
+
+ {/if}
+ {/if}
+
+
+
{$t('link_options').toUpperCase()}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if editingLink}
+
+
+
+ {/if}
+
+
+
+
+
+
+
+
+ {#if editingLink}
+
+ {:else}
+
+ {/if}
+
+
diff --git a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
index 7f996396d8a..2331ae01b1f 100644
--- a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
+++ b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte
@@ -7,7 +7,6 @@
import AlbumSummary from '$lib/components/album-page/album-summary.svelte';
import AlbumTitle from '$lib/components/album-page/album-title.svelte';
import ShareInfoModal from '$lib/components/album-page/share-info-modal.svelte';
- import UserSelectionModal from '$lib/components/album-page/user-selection-modal.svelte';
import ActivityStatus from '$lib/components/asset-viewer/activity-status.svelte';
import ActivityViewer from '$lib/components/asset-viewer/activity-viewer.svelte';
import Button from '$lib/components/elements/buttons/button.svelte';
@@ -29,7 +28,6 @@
import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
- import CreateSharedLinkModal from '$lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte';
import {
NotificationType,
notificationController,
@@ -37,12 +35,17 @@
import UserAvatar from '$lib/components/shared-components/user-avatar.svelte';
import { AlbumPageViewMode, AppRoute } from '$lib/constants';
import { activityManager } from '$lib/managers/activity-manager.svelte';
+ import { modalManager } from '$lib/managers/modal-manager.svelte';
+ import AlbumShareModal from '$lib/modals/AlbumShareModal.svelte';
+ import QrCodeModal from '$lib/modals/QrCodeModal.svelte';
+ import SharedLinkCreateModal from '$lib/modals/SharedLinkCreateModal.svelte';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { AssetStore } from '$lib/stores/assets-store.svelte';
+ import { serverConfig } from '$lib/stores/server-config.store';
import { SlideshowNavigation, SlideshowState, slideshowStore } from '$lib/stores/slideshow.store';
import { preferences, user } from '$lib/stores/user.store';
- import { handlePromiseError } from '$lib/utils';
+ import { handlePromiseError, makeSharedLinkUrl } from '$lib/utils';
import { confirmAlbumDelete } from '$lib/utils/album-utils';
import { cancelMultiselect, downloadAlbum } from '$lib/utils/asset-utils';
import { openFileUploadDialog } from '$lib/utils/file-uploader';
@@ -178,10 +181,6 @@
const handleEscape = async () => {
assetStore.suspendTransitions = true;
- if (viewMode === AlbumPageViewMode.SELECT_USERS) {
- viewMode = AlbumPageViewMode.VIEW;
- return;
- }
if (viewMode === AlbumPageViewMode.SELECT_THUMBNAIL) {
viewMode = AlbumPageViewMode.VIEW;
return;
@@ -190,10 +189,6 @@
await handleCloseSelectAssets();
return;
}
- if (viewMode === AlbumPageViewMode.LINK_SHARING) {
- viewMode = AlbumPageViewMode.VIEW;
- return;
- }
if (viewMode === AlbumPageViewMode.OPTIONS) {
viewMode = AlbumPageViewMode.VIEW;
return;
@@ -423,6 +418,31 @@
const currentAssetIntersection = $derived(
viewMode === AlbumPageViewMode.SELECT_ASSETS ? timelineInteraction : assetInteraction,
);
+
+ const handleShare = async () => {
+ const result = await modalManager.show(AlbumShareModal, { album });
+
+ switch (result?.action) {
+ case 'sharedLink': {
+ await handleShareLink();
+ return;
+ }
+
+ case 'sharedUsers': {
+ await handleAddUsers(result.data);
+ return;
+ }
+ }
+ };
+
+ const handleShareLink = async () => {
+ const sharedLink = await modalManager.show(SharedLinkCreateModal, { albumId: album.id });
+
+ if (sharedLink) {
+ const url = makeSharedLinkUrl($serverConfig.externalDomain, sharedLink.key);
+ await modalManager.show(QrCodeModal, { title: $t('view_link'), value: url });
+ }
+ };
@@ -496,11 +516,7 @@
{/if}
{#if isOwned}
-
(viewMode = AlbumPageViewMode.SELECT_USERS)}
- icon={mdiShareVariantOutline}
- />
+
{/if}
@@ -530,12 +546,7 @@
{/if}
{#if isCreatingSharedAlbum && album.albumUsers.length === 0}
-
{/if}
-{#if viewMode === AlbumPageViewMode.SELECT_USERS}
-