Skip to content

Commit

Permalink
viewer cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Apr 25, 2024
1 parent 7dd3406 commit 111d55c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
1 change: 1 addition & 0 deletions src/langs/json/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@
"collaborate": "Manage Collaborators",
"edit": "Edit",
"upload": "Upload Documents",
"download": "Download file",
"addons": {
"title": "Add-Ons",
"pinned": "Pinned add-ons will appear here"
Expand Down
31 changes: 16 additions & 15 deletions src/routes/documents/[id]-[slug]/sidebar/Actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Pencil16,
Share16,
} from "svelte-octicons";
import { _ } from "svelte-i18n";
import Action from "$lib/components/common/Action.svelte";
import Flex from "$lib/components/common/Flex.svelte";
Expand All @@ -37,51 +38,51 @@
<Flex direction="column">
<SidebarItem>
<Lock16 />
<span class="access">{document.access} access</span>
<span class="access"
>{$_(`access.${document.access}.title`)} {$_("access.access")}</span
>

<SignedIn>
<Action icon={Pencil16}><a href={edit}>Edit</a></Action>
<Action icon={Pencil16}><a href={edit}>{$_("sidebar.edit")}</a></Action>
</SignedIn>
</SidebarItem>

<SidebarItem href={revisions}>
<History16 />
Revision History
</SidebarItem>
{#if document.revision_control}
<SidebarItem href={revisions}>
<History16 />
{$_("sidebar.revisions")}
</SidebarItem>
{/if}

<SidebarItem href={pdf} download>
<Download16 />
Download File
{$_("sidebar.download")}
</SidebarItem>
</Flex>

<Flex direction="column">
<SidebarItem>
<Share16 />
Share &hellip;
{$_("sidebar.share")} &hellip;
</SidebarItem>

<SidebarItem href={annotate}>
<Comment16 />
Add a note &hellip;
{$_("sidebar.annotate")} &hellip;
</SidebarItem>

<SidebarItem href={redact}>
<EyeClosed16 />
Redact &hellip;
{$_("sidebar.redact")} &hellip;
</SidebarItem>

<SidebarItem href={modify}>
<Apps16 />
Modify Pages &hellip;
{$_("sidebar.modify")} &hellip;
</SidebarItem>
</Flex>

<style>
.access {
text-transform: capitalize;
}
a {
color: var(--black);
text-decoration: none;
Expand Down
30 changes: 17 additions & 13 deletions src/routes/documents/[id]-[slug]/sidebar/DocumentMetadata.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,22 @@
- uploaded
-->
<Flex direction="column" gap={1}>
<SidebarItem>
<h1>{document.title}</h1>
</SidebarItem>

<SidebarItem>
{#if document.description}
<p class="description">
{document.description}
</p>
{/if}
<header>
<h1>
{document.title}
</h1>
<SignedIn>
<Action icon={Pencil16}><a href={edit}>Edit</a></Action>
</SignedIn>
</SidebarItem>
</header>

{#if document.description}
<p class="description">
{document.description}
</p>
{/if}
<Metadata key="Contributed by" value={userOrgString(document)} />
<Flex>
<Metadata key="Contributed by" value={userOrgString(document)}></Metadata>

<Metadata key="Last updated on" value={dateFormat(document.updated_at)}
><Clock16 slot="icon" />
</Metadata>
Expand All @@ -61,3 +59,9 @@
</Metadata>
</Flex>
</Flex>

<style>
header h1 {
display: inline;
}
</style>

0 comments on commit 111d55c

Please sign in to comment.