mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 15:29:36 +02:00
feat: Improve UI layout and functionality for adventure search
This commit is contained in:
parent
2bb1d80a77
commit
b8994a531f
3 changed files with 55 additions and 15 deletions
|
@ -359,24 +359,28 @@
|
|||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<h1 class="text-center font-bold text-4xl mt-4 mb-2">Linked Adventures</h1>
|
||||
{#if adventures.length == 0}
|
||||
|
||||
{#if adventures.length == 0 && transportations.length == 0}
|
||||
<NotFound error={undefined} />
|
||||
{/if}
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
{#each adventures as adventure}
|
||||
<AdventureCard
|
||||
user={data.user}
|
||||
on:edit={editAdventure}
|
||||
on:delete={deleteAdventure}
|
||||
type={adventure.type}
|
||||
{adventure}
|
||||
on:typeChange={changeType}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
{#if adventures.length > 0}
|
||||
<h1 class="text-center font-bold text-4xl mt-4 mb-2">Linked Adventures</h1>
|
||||
|
||||
{#if collection.transportations && collection.transportations.length > 0}
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
{#each adventures as adventure}
|
||||
<AdventureCard
|
||||
user={data.user}
|
||||
on:edit={editAdventure}
|
||||
on:delete={deleteAdventure}
|
||||
type={adventure.type}
|
||||
{adventure}
|
||||
on:typeChange={changeType}
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if transportations.length > 0}
|
||||
<h1 class="text-center font-bold text-4xl mt-4 mb-4">Transportation</h1>
|
||||
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
|
||||
{#each transportations as transportation}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
import { fail, redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
|
||||
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
||||
|
||||
export const load = (async (event) => {
|
||||
const token = event.url.searchParams.get('token');
|
||||
const uid = event.url.searchParams.get('uid');
|
||||
console.log('token', token);
|
||||
|
||||
if (!token) {
|
||||
return redirect(302, '/settings/forgot-password');
|
||||
} else {
|
||||
let response = await fetch(`${serverEndpoint}/auth/password/reset/confirm/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: token,
|
||||
uid: uid,
|
||||
new_password1: 'password',
|
||||
new_password2: 'password'
|
||||
})
|
||||
});
|
||||
let data = await response.json();
|
||||
console.log('data', data);
|
||||
}
|
||||
|
||||
return {};
|
||||
}) satisfies PageServerLoad;
|
|
@ -0,0 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data: PageData;
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue