adds profile link for comments
This commit is contained in:
@@ -39,13 +39,38 @@
|
|||||||
in:fade={{ duration: 150 }}
|
in:fade={{ duration: 150 }}
|
||||||
out:fade={{ duration: 150 }}
|
out:fade={{ duration: 150 }}
|
||||||
>
|
>
|
||||||
<img class="rounded-full w-10 aspect-square" src={avatarSrc} alt="avatar" />
|
{#if comment.expand?.author.private}
|
||||||
|
<img
|
||||||
|
class="rounded-full w-10 aspect-square"
|
||||||
|
src={avatarSrc}
|
||||||
|
alt="avatar"
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<a
|
||||||
|
href="/profile/{comment.expand?.author.id}"
|
||||||
|
class="text-sm font-semibold"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
class="rounded-full w-10 aspect-square"
|
||||||
|
src={avatarSrc}
|
||||||
|
alt="avatar"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
<div>
|
<div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<p class="">
|
<p class="">
|
||||||
<span class="text-sm font-semibold"
|
{#if comment.expand?.author.private}
|
||||||
>{comment.expand?.author.username}</span
|
<span class="text-sm font-semibold"
|
||||||
>
|
>{comment.expand?.author.username}</span
|
||||||
|
>
|
||||||
|
{:else}
|
||||||
|
<a
|
||||||
|
href="/profile/{comment.expand?.author.id}"
|
||||||
|
class="text-sm font-semibold"
|
||||||
|
>{comment.expand?.author.username}</a
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
<span class="text-xs text-gray-500 ml-2"
|
<span class="text-xs text-gray-500 ml-2"
|
||||||
>{$_(`n-${timeSince.unit}-ago`, {
|
>{$_(`n-${timeSince.unit}-ago`, {
|
||||||
values: { n: timeSince.value },
|
values: { n: timeSince.value },
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ export async function GET(event: RequestEvent) {
|
|||||||
const page = event.url.searchParams.get("page") ?? "0";
|
const page = event.url.searchParams.get("page") ?? "0";
|
||||||
const perPage = event.url.searchParams.get("per-page") ?? "10";
|
const perPage = event.url.searchParams.get("per-page") ?? "10";
|
||||||
const sort = event.url.searchParams.get("sort") ?? ""
|
const sort = event.url.searchParams.get("sort") ?? ""
|
||||||
const filter = event.url.searchParams.get("filter") ?? "";
|
let filter = event.url.searchParams.get("filter") ?? "";
|
||||||
|
|
||||||
|
if (!filter.length) {
|
||||||
|
filter = "private=false"
|
||||||
|
} else {
|
||||||
|
filter += "&&private=false"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const r = await pb.collection('users_anonymous')
|
const r = await pb.collection('users_anonymous')
|
||||||
|
|||||||
Reference in New Issue
Block a user