Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments, GPX Maps, Global Search, Security #460

Merged
merged 37 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9132ef3
fix: add 'finding_recommendations' key and update 'no_adventures_to_r…
seanmorley15 Jan 18, 2025
d60945d
feat: implement global search functionality for adventures, collectio…
seanmorley15 Jan 18, 2025
f10e171
fix: update RegionCard component to handle undefined visited state an…
seanmorley15 Jan 18, 2025
433599d
feat: implement protected media serving and permission checks for adv…
seanmorley15 Jan 18, 2025
aa216f5
feat: add Attachment model and implement file permission checks for m…
seanmorley15 Jan 19, 2025
e0fa62c
feat: add GSAP animations to signup, login, and dashboard pages; incl…
seanmorley15 Jan 19, 2025
e9538b7
Add basic PWA
larsl-net Jan 19, 2025
3ccd078
Add Service Worker
larsl-net Jan 19, 2025
a88e598
Fix service worker
larsl-net Jan 19, 2025
94c3e3d
feat: implement attachment management with upload, delete, and permis…
seanmorley15 Jan 20, 2025
1f3abf7
feat: replace placeholder image with gradient background and text for…
seanmorley15 Jan 20, 2025
25edec4
feat: enhance search page with reactive data updates and simplify com…
seanmorley15 Jan 20, 2025
30c58ca
feat: refactor AttachmentCard component to handle delete action local…
seanmorley15 Jan 20, 2025
64d2bde
feat: add GPX file handling and GeoJSON integration in adventure page…
seanmorley15 Jan 21, 2025
f9cf920
feat: enhance CategoryModal with loading state and remove unused acti…
seanmorley15 Jan 22, 2025
1b3cf6a
feat: add keyboard shortcut to focus search input in Navbar and clean…
seanmorley15 Jan 22, 2025
6e28e52
feat: enhance attachment handling with new localization strings and G…
seanmorley15 Jan 22, 2025
3f30819
feat: add GPX file support in AdventureModal and improve map marker h…
seanmorley15 Jan 22, 2025
10230e9
build(deps-dev): bump vite
dependabot[bot] Jan 22, 2025
1447a94
Merge pull request #461 from seanmorley15/dependabot/npm_and_yarn/fro…
seanmorley15 Jan 22, 2025
d5fe7ee
build(deps): bump the npm_and_yarn group across 2 directories with 1 …
dependabot[bot] Jan 22, 2025
6ea0e07
Merge pull request #462 from seanmorley15/dependabot/npm_and_yarn/doc…
seanmorley15 Jan 22, 2025
0eb4bc7
feat: enhance adventure handling with user ID support in serializers …
seanmorley15 Jan 22, 2025
12a6429
Merge branch 'development' of github.com:seanmorley15/AdventureLog in…
seanmorley15 Jan 22, 2025
9e66c67
fix: Display adventure category icon also on collection maps
larsl-net Jan 23, 2025
f04a6e3
Remove package-lock.json
larsl-net Jan 23, 2025
69967b7
fix: Error loading calender when transport has no date
larsl-net Jan 23, 2025
8fee537
feat: Open collection calendar on start date
larsl-net Jan 23, 2025
8fef53f
Merge pull request #466 from larsl-net/calendar-collection-range
seanmorley15 Jan 23, 2025
6b09009
Merge pull request #465 from larsl-net/collection-map-icons
seanmorley15 Jan 23, 2025
abaee8c
feat: Add attachments array to recommendation object and update optio…
seanmorley15 Jan 23, 2025
37fca9b
Merge branch 'development' of github.com:seanmorley15/AdventureLog in…
seanmorley15 Jan 23, 2025
6a5bfbd
feat: Enhance adventure marker popup with image carousel and visit de…
seanmorley15 Jan 23, 2025
d326d38
feat: Update session cookie domain handling using publicsuffix2 and p…
seanmorley15 Jan 27, 2025
f5dc0ce
feat: Refactor session cookie domain handling to use psl for improved…
seanmorley15 Jan 27, 2025
680a237
Merge pull request #458 from larsl-net/basic-pwa
seanmorley15 Jan 27, 2025
3468e82
feat: Sanitize FRONTEND_URL by removing quotes for improved URL parsing
seanmorley15 Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add GSAP animations to signup, login, and dashboard pages; incl…
…ude Attachment serializer in backend
seanmorley15 committed Jan 19, 2025
commit e0fa62c1ea4f46b78ac169dc9d272f46b1056749
25 changes: 23 additions & 2 deletions backend/server/adventures/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.utils import timezone
import os
from .models import Adventure, AdventureImage, ChecklistItem, Collection, Note, Transportation, Checklist, Visit, Category
from .models import Adventure, AdventureImage, ChecklistItem, Collection, Note, Transportation, Checklist, Visit, Category, Attachment
from rest_framework import serializers
from main.utils import CustomModelSerializer

@@ -21,6 +21,26 @@ def to_representation(self, instance):
representation['image'] = f"{public_url}/media/{instance.image.name}"
return representation

class AttachmentSerializer(CustomModelSerializer):
extension = serializers.SerializerMethodField()
class Meta:
model = Attachment
fields = ['id', 'file', 'adventure', 'extension']
read_only_fields = ['id']

def get_extension(self, obj):
return obj.file.name.split('.')[-1]

def to_representation(self, instance):
representation = super().to_representation(instance)
if instance.file:
public_url = os.environ.get('PUBLIC_URL', 'http://127.0.0.1:8000').rstrip('/')
#print(public_url)
# remove any ' from the url
public_url = public_url.replace("'", "")
representation['file'] = f"{public_url}/media/{instance.file.name}"
return representation

class CategorySerializer(serializers.ModelSerializer):
num_adventures = serializers.SerializerMethodField()
class Meta:
@@ -57,6 +77,7 @@ class Meta:
class AdventureSerializer(CustomModelSerializer):
images = AdventureImageSerializer(many=True, read_only=True)
visits = VisitSerializer(many=True, read_only=False, required=False)
attachments = AttachmentSerializer(many=True, read_only=True)
category = CategorySerializer(read_only=False, required=False)
is_visited = serializers.SerializerMethodField()

@@ -65,7 +86,7 @@ class Meta:
fields = [
'id', 'user_id', 'name', 'description', 'rating', 'activity_types', 'location',
'is_public', 'collection', 'created_at', 'updated_at', 'images', 'link', 'longitude',
'latitude', 'visits', 'is_visited', 'category'
'latitude', 'visits', 'is_visited', 'category', 'attachments'
]
read_only_fields = ['id', 'created_at', 'updated_at', 'user_id', 'is_visited']

Empty file removed backend/server/adventures/views.py
Empty file.
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -41,9 +41,11 @@
"dependencies": {
"@lukulent/svelte-umami": "^0.0.3",
"emoji-picker-element": "^1.26.0",
"gsap": "^3.12.7",
"marked": "^15.0.4",
"qrcode": "^1.5.4",
"svelte-i18n": "^4.0.1",
"svelte-maplibre": "^0.9.8"
"svelte-maplibre": "^0.9.8",
"tsparticles": "^3.7.1"
}
}
393 changes: 393 additions & 0 deletions frontend/pnpm-lock.yaml

Large diffs are not rendered by default.

61 changes: 56 additions & 5 deletions frontend/src/routes/dashboard/+page.svelte
Original file line number Diff line number Diff line change
@@ -2,6 +2,57 @@
import AdventureCard from '$lib/components/AdventureCard.svelte';
import type { PageData } from './$types';
import { t } from 'svelte-i18n';
import { onMount } from 'svelte';
import { gsap } from 'gsap';
// Initial animation for page load
onMount(() => {
// Stat animations with quicker duration
gsap.from('.stat', {
opacity: 0,
y: 50,
duration: 0.6, // Quicker animation duration
stagger: 0.1, // Faster staggering between elements
ease: 'power2.out' // Slightly sharper easing for quicker feel
});
gsap.from('.stat-title', {
opacity: 0,
x: -50, // Smaller movement for quicker animation
duration: 0.6, // Quicker animation duration
stagger: 0.1, // Faster staggering
ease: 'power2.out'
});
// Stat values with faster reveal and snappier effect
gsap.from('.stat-value', {
opacity: 0,
scale: 0.8, // Slightly less scaling for a snappier effect
duration: 1, // Shorter duration
stagger: 0.2, // Faster staggering
ease: 'power2.out', // Snappier easing
delay: 0.3 // Faster delay for quicker sequencing
});
// Adventure card animations with quicker reveal
gsap.from('.adventure-card', {
opacity: 0,
y: 50, // Less movement for snappier feel
duration: 0.8, // Quicker duration
stagger: 0.1, // Faster staggering
ease: 'power2.out',
delay: 0.6 // Shorter delay for quicker appearance
});
// Inspiration section with faster bounce effect
gsap.from('.inspiration', {
opacity: 0,
scale: 0.7, // Less scale for snappier effect
duration: 1, // Slightly quicker duration
ease: 'elastic.out(0.75, 0.5)', // Snappier bounce
delay: 1 // Reduced delay for quicker animation
});
});
export let data: PageData;
@@ -19,9 +70,7 @@
<!-- Welcome Message -->
<div class="mb-8">
<h1 class="text-4xl font-extrabold">
{$t('dashboard.welcome_back')}, {user?.first_name
? `${user.first_name} ${user.last_name}`
: user?.username}!
{$t('dashboard.welcome_back')}, {user?.first_name ? `${user.first_name}` : user?.username}!
</h1>
</div>

@@ -62,15 +111,17 @@
<h2 class="text-3xl font-semibold mb-4">{$t('dashboard.recent_adventures')}</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
{#each recentAdventures as adventure}
<AdventureCard {adventure} user={data.user} readOnly />
<div class="adventure-card">
<AdventureCard {adventure} user={data.user} readOnly />
</div>
{/each}
</div>
{/if}

<!-- Inspiration if there are no recent adventures -->
{#if recentAdventures.length === 0}
<div
class="flex flex-col items-center justify-center bg-neutral shadow p-8 mb-8 rounded-lg text-neutral-content"
class="inspiration flex flex-col items-center justify-center bg-neutral shadow p-8 mb-8 rounded-lg text-neutral-content"
>
<h2 class="text-3xl font-semibold mb-4">{$t('dashboard.no_recent_adventures')}</h2>
<p class="text-lg text-center">
23 changes: 23 additions & 0 deletions frontend/src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
@@ -15,6 +15,29 @@
import OpenIdConnect from '~icons/mdi/openid';
import { page } from '$app/stores';
import { gsap } from 'gsap'; // Import GSAP
import { onMount } from 'svelte';
onMount(() => {
gsap.from('.card', {
opacity: 0,
y: 50,
duration: 1,
ease: 'power3.out'
});
gsap.from('.text-center', {
opacity: 0,
x: -50,
duration: 1,
ease: 'power2.out'
});
gsap.from('.input', {
opacity: 0,
y: 30,
duration: 1,
ease: 'power2.out'
});
});
import ImageInfoModal from '$lib/components/ImageInfoModal.svelte';
import type { Background } from '$lib/types.js';
23 changes: 23 additions & 0 deletions frontend/src/routes/signup/+page.svelte
Original file line number Diff line number Diff line change
@@ -4,6 +4,29 @@
export let data;
console.log(data);
import { gsap } from 'gsap'; // Import GSAP
import { onMount } from 'svelte';
onMount(() => {
gsap.from('.card', {
opacity: 0,
y: 50,
duration: 1,
ease: 'power3.out'
});
gsap.from('.text-center', {
opacity: 0,
x: -50,
duration: 1,
ease: 'power2.out'
});
gsap.from('.input', {
opacity: 0,
y: 30,
duration: 1,
ease: 'power2.out'
});
});
import FileImageBox from '~icons/mdi/file-image-box';