diff --git a/src/lib/components/lemmy/comment/CommentActions.svelte b/src/lib/components/lemmy/comment/CommentActions.svelte index 6dbd976c..a380fe84 100644 --- a/src/lib/components/lemmy/comment/CommentActions.svelte +++ b/src/lib/components/lemmy/comment/CommentActions.svelte @@ -72,9 +72,7 @@ { navigator.clipboard.writeText( - `${$page.url.origin}/post/${getInstance()}/${ - comment.post.id - }?thread=${comment.comment.path}#${comment.comment.id}` + `/comment/${getInstance()}/${comment.comment.id}` ) }} > diff --git a/src/routes/comment/[instance]/+page.ts b/src/routes/comment/[instance]/+page.ts new file mode 100644 index 00000000..7cec2e91 --- /dev/null +++ b/src/routes/comment/[instance]/+page.ts @@ -0,0 +1,6 @@ +import { getInstance } from '$lib/lemmy.js' +import { redirect } from '@sveltejs/kit' + +export function load({ params }) { + throw redirect(300, `/comment/${getInstance()}/${params.instance}`) +} diff --git a/src/routes/comment/[id]/+page.ts b/src/routes/comment/[instance]/[id]/+page.ts similarity index 100% rename from src/routes/comment/[id]/+page.ts rename to src/routes/comment/[instance]/[id]/+page.ts diff --git a/src/routes/modlog/+page.svelte b/src/routes/modlog/+page.svelte index c2f1947a..62114617 100644 --- a/src/routes/modlog/+page.svelte +++ b/src/routes/modlog/+page.svelte @@ -7,10 +7,44 @@

Modlog

{#if data.modlog} -
+ + diff --git a/src/routes/modlog/+page.ts b/src/routes/modlog/+page.ts index 0f782da2..d5449ac3 100644 --- a/src/routes/modlog/+page.ts +++ b/src/routes/modlog/+page.ts @@ -57,6 +57,7 @@ export const _toModLog = (item: ModAction): ModLog => { timestamp: Date.parse(`${item.mod_remove_post.when_}Z`), moderator: item.moderator, reason: item.mod_remove_post.reason, + link: `/post/${item.post.id}`, } } @@ -90,7 +91,9 @@ export async function load({ url }) { ...results.removed_posts, ] - const moderationActions = moderation.map(_toModLog) + const moderationActions = moderation + .map(_toModLog) + .sort((b, a) => b.timestamp - a.timestamp) return { modlog: moderationActions, diff --git a/src/routes/modlog/ModlogItem.svelte b/src/routes/modlog/ModlogItem.svelte index a3af95bc..381b7601 100644 --- a/src/routes/modlog/ModlogItem.svelte +++ b/src/routes/modlog/ModlogItem.svelte @@ -9,23 +9,28 @@ export let item: ModLog - - Action - {item.actionName} - {#if item.moderator} - Moderator - - {/if} - {#if item.moderatee} - Moderatee - - {/if} - {#if item.community} - Community - - {/if} - {#if item.link} - Link - - {/if} - + + + {item.actionName} + + + {#if item.moderator} + + {/if} + + + {#if item.moderatee} + + {/if} + + + {#if item.community} + + {/if} + + + {#if item.link} + + {/if} + +