From dcfe1bfa7dcb8408cf0e709689f996d2710bf54e Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Tue, 10 Dec 2024 13:54:50 -0500 Subject: [PATCH 1/4] Logged-out handling on document pages --- src/lib/components/documents/Header.svelte | 17 ++++++++------- .../components/layouts/DocumentLayout.svelte | 21 +++++++++++-------- .../components/sidebar/ViewerActions.svelte | 4 ++-- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/lib/components/documents/Header.svelte b/src/lib/components/documents/Header.svelte index c654105bb..cfe152fd1 100644 --- a/src/lib/components/documents/Header.svelte +++ b/src/lib/components/documents/Header.svelte @@ -11,8 +11,9 @@ import { _ } from "svelte-i18n"; import { ALLOWED_TAGS, ALLOWED_ATTR } from "@/config/config.js"; - import { remToPx } from "@/lib/utils/layout"; - import Access, { getLevel } from "../common/Access.svelte"; + import Access, { getLevel } from "$lib/components/common/Access.svelte"; + import { remToPx } from "$lib/utils/layout"; + import SignedIn from "../common/SignedIn.svelte"; export let document: Document; @@ -33,11 +34,13 @@
- {#if access} -
- -
- {/if} + + {#if access} +
+ +
+ {/if} +

{document.title}

{#if description}
diff --git a/src/lib/components/layouts/DocumentLayout.svelte b/src/lib/components/layouts/DocumentLayout.svelte index 79ceaac11..9278f4df0 100644 --- a/src/lib/components/layouts/DocumentLayout.svelte +++ b/src/lib/components/layouts/DocumentLayout.svelte @@ -22,6 +22,7 @@ Assumes it's a child of a ViewerContext import { getCurrentUser } from "$lib/utils/permissions"; import { isOrg } from "$lib/api/accounts"; import { getDocument, getText } from "../viewer/ViewerContext.svelte"; + import SignedIn from "../common/SignedIn.svelte"; const me = getCurrentUser(); @@ -34,11 +35,13 @@ Assumes it's a child of a ViewerContext - + + +
@@ -55,10 +58,10 @@ Assumes it's a child of a ViewerContext {/if} - {#if $me} - - {/if} - + + + + {#await text then text} diff --git a/src/lib/components/sidebar/ViewerActions.svelte b/src/lib/components/sidebar/ViewerActions.svelte index 69b4c93ab..378655391 100644 --- a/src/lib/components/sidebar/ViewerActions.svelte +++ b/src/lib/components/sidebar/ViewerActions.svelte @@ -1,7 +1,7 @@
+ {#if document.published_url} + + + {new URL(document.published_url).hostname} + + + + {/if} + {#if document.source} + + {document.source} + + {/if} {userOrgString(document)} @@ -70,4 +84,10 @@ gap: 1rem; padding: 0 0.5rem 1rem 0; } + .publishedUrl { + display: flex; + align-items: center; + fill: var(--blue-3); + gap: 0.25rem; + } diff --git a/src/lib/components/documents/stories/Metadata.stories.svelte b/src/lib/components/documents/stories/Metadata.stories.svelte new file mode 100644 index 000000000..2eee9eebc --- /dev/null +++ b/src/lib/components/documents/stories/Metadata.stories.svelte @@ -0,0 +1,31 @@ + + + + + From 1ec8a75b0893c365d9092b0826cb25c196dd84c2 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Tue, 10 Dec 2024 14:25:03 -0500 Subject: [PATCH 3/4] Adjust sidebar slot --- src/lib/components/layouts/DocumentLayout.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/layouts/DocumentLayout.svelte b/src/lib/components/layouts/DocumentLayout.svelte index 9278f4df0..a16cee4c1 100644 --- a/src/lib/components/layouts/DocumentLayout.svelte +++ b/src/lib/components/layouts/DocumentLayout.svelte @@ -35,8 +35,8 @@ Assumes it's a child of a ViewerContext - -