Skip to content

Commit

Permalink
Merge pull request #160 from seanmorley15/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
seanmorley15 authored Aug 5, 2024
2 parents c01b0b4 + 7c61fa3 commit 885112f
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 92 deletions.
3 changes: 3 additions & 0 deletions backend/server/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@

)

# disable verifications for new users
ACCOUNT_EMAIL_VERIFICATION = 'none'

# For backwards compatibility for Django 1.8
MIDDLEWARE_CLASSES = MIDDLEWARE

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/CollectionCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
) + 1}{' '}
days
</p>{/if}
<div class="badge badge-neutral">{collection.is_public ? 'Public' : 'Private'}</div>
<div class="card-actions justify-end">
{#if type != 'link'}
<button on:click={deleteCollection} class="btn btn-secondary"
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/lib/components/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
const searchGo = async (e: Event) => {
e.preventDefault();
let reload: boolean = false;
if ($page.url.pathname === '/search') {
reload = true;
let url = new URL(window.location.href);
url.searchParams.set('query', query);
goto(url.toString(), { invalidateAll: true });
}
if (query) {
await goto(`/search?query=${query}`);
if (reload) {
window.location.reload();
}
goto(`/search?query=${query}`);
}
};
</script>
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/lib/components/NoteCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
>
<div class="card-body">
<h2 class="card-title overflow-ellipsis">{note.name}</h2>
{#if note.links && note.links.length > 0}
<p>{note.links.length} links</p>
{/if}
<div class="card-actions justify-end">
<!-- <button class="btn btn-neutral mb-2" on:click={() => goto(`/notes/${note.id}`)}
><Launch class="w-6 h-6" />Open Details</button
Expand All @@ -45,7 +48,7 @@
id="delete_adventure"
data-umami-event="Delete Adventure"
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}
</div>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/lib/components/NoteModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@
{#if newNote.links.length > 0}
<ul class="list-none">
{#each newNote.links as link, i}
<li class="mb-1">
<a href={link} target="_blank">{link}</a>
<li class="mb-4">
<a href={link} class="link link-primary" target="_blank">{link}</a>
<button
type="button"
class="btn btn-sm btn-error"
class="btn btn-sm btn-error absolute right-0 mr-4"
on:click={() => {
newNote.links = newNote.links.filter((_, index) => index !== i);
}}
Expand Down Expand Up @@ -199,11 +199,11 @@
</div>
{/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>

{#if collection.is_public}
<div role="alert" class="alert alert-info mt-4">
<div role="alert" class="alert mt-4">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/routes/collections/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
112 changes: 56 additions & 56 deletions frontend/src/routes/search/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import type { PageData } from './$types';
import EditAdventure from '$lib/components/EditAdventure.svelte';
import { appVersion } from '$lib/config';
import { goto, invalidate } from '$app/navigation';
import { goto } from '$app/navigation';
export let data: PageData;
Expand Down Expand Up @@ -110,61 +110,61 @@

{#if myAdventures.length !== 0 && publicAdventures.length !== 0}
<h2 class="text-center font-bold text-2xl mb-4">AdventureLog Results</h2>
{/if}
<div class="flex items-center justify-center mt-2 mb-2">
<div class="join">
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="All"
id="all"
checked
on:change={() => (property = 'all')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Name"
id="name"
on:change={() => (property = 'name')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Type"
id="type"
on:change={() => (property = 'type')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Location"
id="location"
on:change={() => (property = 'location')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Description"
id="description"
on:change={() => (property = 'description')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Activity Types"
id="activity_types"
on:change={() => (property = 'activity_types')}
/>
<div class="flex items-center justify-center mt-2 mb-2">
<div class="join">
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="All"
id="all"
checked
on:change={() => (property = 'all')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Name"
id="name"
on:change={() => (property = 'name')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Type"
id="type"
on:change={() => (property = 'type')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Location"
id="location"
on:change={() => (property = 'location')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Description"
id="description"
on:change={() => (property = 'description')}
/>
<input
class="join-item btn"
type="radio"
name="filter"
aria-label="Activity Types"
id="activity_types"
on:change={() => (property = 'activity_types')}
/>
</div>
<button class="btn btn-primary ml-2" type="button" on:click={filterByProperty}>Filter</button>
</div>
<button class="btn btn-primary ml-2" type="button" on:click={filterByProperty}>Filter</button>
</div>
{/if}

{#if myAdventures.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">My Adventures</h2>
Expand Down Expand Up @@ -199,7 +199,7 @@
<div class="divider"></div>
{/if}
{#if osmResults.length > 0}
<h2 class="text-center font-bold text-2xl mb-4">Online Results</h2>
<h2 class="text-center font-bold mt-2 text-2xl mb-4">Online Results</h2>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each osmResults as result}
<div class="bg-base-300 rounded-lg shadow-md p-4 w-96 mb-2">
Expand Down
71 changes: 47 additions & 24 deletions frontend/src/routes/settings/forgot-password/confirm/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
<script lang="ts">
import { enhance } from '$app/forms';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import type { PageData } from './$types';
export let data: PageData;
</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>
<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>
{/if}
<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>
{: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>
</form>
{/if}

0 comments on commit 885112f

Please sign in to comment.