adds privacy settings

This commit is contained in:
Christian Beutel
2024-12-17 00:53:27 +01:00
parent 43b6be8fb2
commit 92f0b033fa
25 changed files with 2025 additions and 28 deletions

View File

@@ -3,6 +3,7 @@
text: string;
value: string;
icon?: string;
description?: string;
};
</script>
@@ -32,6 +33,13 @@
class="w-4 h-4 accent-primary border-input-border focus:ring-input-ring focus:ring-2"
on:change={() => handleRadioChange(i)}
/>
<label for="{name}-radio-{i}" class="ms-2 text-sm">{item.text}</label>
<div class="ms-2 text-sm">
<label for="{name}-radio-{i}"
>{item.text}
{#if item.description}
<p class="text-gray-500">{item.description}</p>
{/if}
</label>
</div>
</div>
{/each}

View File

@@ -134,9 +134,13 @@
`https://api.dicebear.com/7.x/initials/svg?seed=${list.expand.author.username}&backgroundType=gradientLinear`}
alt="avatar"
/>
<a class="underline" href="/profile/{list.expand.author.id}"
>{list.expand.author.username}</a
>
{#if !list.expand.author.private}
<a class="underline" href="/profile/{list.expand.author.id}"
>{list.expand.author.username}</a
>
{:else}
<span>{list.expand.author.username}</span>
{/if}
</p>
{/if}
<hr />

View File

@@ -23,8 +23,16 @@
alt="avatar"
/>
<div>
<a class="underline" href="/profile/{user.id}"> {user.username} </a>
{activity.type === "trail" ? $_("planned-a-trail") : $_("completed-a-trail")}
{#if !user.private}
<a class="underline" href="/profile/{user.id}"
>{user.username}</a
>
{:else}
<span>{user.username}</span>
{/if}
{activity.type === "trail"
? $_("planned-a-trail")
: $_("completed-a-trail")}
<p class="text-xs text-gray-500 mb-3">
{new Date(activity.date).toLocaleDateString(undefined, {
month: "long",
@@ -83,7 +91,13 @@
? activity.description?.substring(0, 100)
: activity.description}
{#if (activity.description?.length ?? 0) > 100 && !fullDescription}
<button on:click={() => (fullDescription = true)}>
<button
on:click={(e) => {
e.stopPropagation();
e.preventDefault();
fullDescription = true;
}}
>
... <span class="underline">{$_("read-more")}</span></button
>
{/if}

View File

@@ -136,7 +136,19 @@
class="tooltip flex justify-center"
data-title={log.expand.author.username}
>
<a href="/profile/{log.expand.author.id}">
{#if !log.expand.author.private}
<a href="/profile/{log.expand.author.id}">
<img
class="rounded-full w-7 aspect-square"
src={getFileURL(
log.expand?.author,
log.expand?.author.avatar,
) ||
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand?.author.username}&backgroundType=gradientLinear`}
alt="avatar"
/>
</a>
{:else}
<img
class="rounded-full w-7 aspect-square"
src={getFileURL(
@@ -146,7 +158,7 @@
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand?.author.username}&backgroundType=gradientLinear`}
alt="avatar"
/>
</a>
{/if}
</p>
</td>
{/if}
@@ -166,4 +178,4 @@
td {
padding: 0.3rem 0.5rem;
}
</style>
</style>

View File

@@ -50,7 +50,6 @@
const trailIsShared =
(trail.expand?.trail_share_via_trail?.length ?? 0) > 0;
let thumbnail = trail.photos.length
? getFileURL(trail, trail.photos[trail.thumbnail])
: "/imgs/default_thumbnail.webp";
@@ -68,14 +67,14 @@
onMount(async () => {});
function openMarkerPopup(i: number) {
if((markers[i] as M.Marker).getPopup().isOpen()) {
if ((markers[i] as M.Marker).getPopup().isOpen()) {
return;
}
(markers[i] as M.Marker).togglePopup();
}
function closeMarkerPopup(i: number) {
if(!(markers[i] as M.Marker).getPopup().isOpen()) {
if (!(markers[i] as M.Marker).getPopup().isOpen()) {
return;
}
(markers[i] as M.Marker).togglePopup();
@@ -195,11 +194,15 @@
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.username}&backgroundType=gradientLinear`}
alt="avatar"
/>
<a
class="underline"
href="/profile/{trail.expand.author.id}"
>{trail.expand.author.username}</a
>
{#if !trail.expand.author.private}
<a
class="underline"
href="/profile/{trail.expand.author.id}"
>{trail.expand.author.username}</a
>
{:else}
<span>{trail.expand.author.username}</span>
{/if}
</p>
{/if}
<div class="flex flex-wrap gap-x-8 gap-y-2 mt-4 mr-8">