1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 14:59:36 +02:00

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

@ -61,6 +61,7 @@
) + 1}{' '} ) + 1}{' '}
days days
</p>{/if} </p>{/if}
<div class="badge badge-neutral">{collection.is_public ? 'Public' : 'Private'}</div>
<div class="card-actions justify-end"> <div class="card-actions justify-end">
{#if type != 'link'} {#if type != 'link'}
<button on:click={deleteCollection} class="btn btn-secondary" <button on:click={deleteCollection} class="btn btn-secondary"

View file

@ -45,7 +45,7 @@
id="delete_adventure" id="delete_adventure"
data-umami-event="Delete Adventure" data-umami-event="Delete Adventure"
class="btn btn-warning" class="btn btn-warning"
on:click={deleteNote}><TrashCan class="w-6 h-6" />Delete</button on:click={deleteNote}><TrashCan class="w-6 h-6" /></button
> >
{/if} {/if}
</div> </div>

View file

@ -164,11 +164,11 @@
{#if newNote.links.length > 0} {#if newNote.links.length > 0}
<ul class="list-none"> <ul class="list-none">
{#each newNote.links as link, i} {#each newNote.links as link, i}
<li class="mb-1"> <li class="mb-4">
<a href={link} target="_blank">{link}</a> <a href={link} class="link link-primary" target="_blank">{link}</a>
<button <button
type="button" type="button"
class="btn btn-sm btn-error" class="btn btn-sm btn-error absolute right-0"
on:click={() => { on:click={() => {
newNote.links = newNote.links.filter((_, index) => index !== i); newNote.links = newNote.links.filter((_, index) => index !== i);
}} }}
@ -199,11 +199,11 @@
</div> </div>
{/if} {/if}
<button class="btn btn-primary" on:click={save}>Save</button> <button class="btn btn-primary mr-1" on:click={save}>Save</button>
<button class="btn btn-neutral" on:click={close}>Close</button> <button class="btn btn-neutral" on:click={close}>Close</button>
{#if collection.is_public} {#if collection.is_public}
<div role="alert" class="alert alert-info mt-4"> <div role="alert" class="alert mt-4">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
fill="none" fill="none"

View file

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

View file

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { enhance } from '$app/forms'; import { enhance } from '$app/forms';
import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import type { PageData } from './$types'; import type { PageData } from './$types';
@ -7,29 +8,51 @@
</script> </script>
<h1 class="text-center font-bold text-4xl mb-4">Change Password</h1> <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} /> {#if data.props.token && data.props.uid}
<input type="hidden" name="token" value={data.props.token} /> <p class="text-center">You will then be redirected to the login page.</p>
<div class="flex items-center justify-center gap-4"> <div
<input class="modal-action items-center"
type="password" style="display: flex; flex-direction: column; align-items: center; width: 100%;"
class="input input-bordered w-full max-w-xs" >
id="new_password1" <form action="?/reset" method="post" use:enhance>
name="new_password1" <input type="hidden" name="uid" value={data.props.uid} />
placeholder="New Password" <input type="hidden" name="token" value={data.props.token} />
/>
<input <div class="mb-2 w-full">
type="password" <input
class="input input-bordered w-full max-w-xs" type="password"
id="new_password2" class="input input-bordered w-full"
name="new_password2" id="new_password1"
placeholder="Confirm Password" name="new_password1"
/> placeholder="New 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}
</div> </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> </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}