feat: Add public/private badge to CollectionCard and fix delete button in NoteCard

This commit is contained in:
Sean Morley
2024-08-04 21:30:11 -04:00
parent 64dec7fe5f
commit 10466f5913
5 changed files with 57 additions and 30 deletions

View File

@@ -412,6 +412,9 @@
{#if collection.name}
<h1 class="text-center font-extrabold text-4xl mb-2">{collection.name}</h1>
{/if}
{#if collection.description}
<p class="text-center text-lg mb-2">{collection.description}</p>
{/if}
{#if adventures.length > 0}
<div class="flex items-center justify-center mb-4">
<div class="stats shadow bg-base-300">

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { enhance } from '$app/forms';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import type { PageData } from './$types';
@@ -7,29 +8,51 @@
</script>
<h1 class="text-center font-bold text-4xl mb-4">Change Password</h1>
<form action="?/reset" method="post" use:enhance>
<input type="hidden" name="uid" value={data.props.uid} />
<input type="hidden" name="token" value={data.props.token} />
<div class="flex items-center justify-center gap-4">
<input
type="password"
class="input input-bordered w-full max-w-xs"
id="new_password1"
name="new_password1"
placeholder="New Password"
/>
<input
type="password"
class="input input-bordered w-full max-w-xs"
id="new_password2"
name="new_password2"
placeholder="Confirm Password"
/>
<button type="submit" class="btn btn-primary"> Submit </button>
{#if $page.form?.message}
<div class="text-center text-error mt-4">
{$page.form?.message}
{#if data.props.token && data.props.uid}
<p class="text-center">You will then be redirected to the login page.</p>
<div
class="modal-action items-center"
style="display: flex; flex-direction: column; align-items: center; width: 100%;"
>
<form action="?/reset" method="post" use:enhance>
<input type="hidden" name="uid" value={data.props.uid} />
<input type="hidden" name="token" value={data.props.token} />
<div class="mb-2 w-full">
<input
type="password"
class="input input-bordered w-full"
id="new_password1"
name="new_password1"
placeholder="New Password"
/>
</div>
{/if}
<div class="mb-2 w-full">
<input
type="password"
class="input input-bordered w-full"
id="new_password2"
name="new_password2"
placeholder="Confirm Password"
/>
</div>
<button type="submit" class="btn btn-primary w-full">Submit</button>
{#if $page.form?.message}
<div class="text-center text-error mt-4">
{$page.form?.message}
</div>
{/if}
</form>
</div>
</form>
{:else}
<div class="flex justify-center">
<div class="items-center justify-center">
<p class="text-center">Token and UID are required for password reset.</p>
<button class="btn btn-neutral" on:click={() => goto('/settings/forgot-password')}>
Reset Password
</button>
</div>
</div>
{/if}