Skip to content

feat: Add Collection Templates & Duplicate Collection#1001

Open
wanoo wants to merge 6 commits intoseanmorley15:developmentfrom
wanoo:feature/duplicate-template
Open

feat: Add Collection Templates & Duplicate Collection#1001
wanoo wants to merge 6 commits intoseanmorley15:developmentfrom
wanoo:feature/duplicate-template

Conversation

@wanoo
Copy link
Copy Markdown

@wanoo wanoo commented Feb 7, 2026

Summary

Add ability to duplicate collections and save them as reusable templates that can be shared with other users.

Features

Duplicate Collection

  • Clone existing collection with all its content
  • Locations are linked (shared reference)
  • Notes, checklists, transportation, and lodging are deep copied
  • Copy name includes date/time for uniqueness (e.g., "Trip - Copy 2026-02-07 14:30")

Collection Templates

  • Save collection as reusable template from collection card menu
  • Templates include locations, notes, checklists, transportation, and lodging structure
  • Dates are excluded from templates
  • Toggle template public/private visibility
  • Public templates visible to all users
  • Create new collection from any template

Template Browser

  • New /templates page with tabs for "My Templates" and "Public Templates"
  • Display template contents (locations, notes, checklists count)
  • Delete own templates
  • Toggle public/private state

API Endpoints

Method Endpoint Description
POST /api/collections/{id}/duplicate/ Duplicate collection
POST /api/collections/{id}/save-as-template/ Save as template
GET /api/collection-templates/ List templates
PATCH /api/collection-templates/{id}/ Update template
POST /api/collection-templates/{id}/create-collection/ Create from template
DELETE /api/collection-templates/{id}/ Delete template

Changes

  • New CollectionTemplate model and migrations
  • New CollectionTemplateSerializer
  • New template_view.py with CollectionTemplateViewSet
  • Added duplicate and save-as-template actions to CollectionViewSet
  • New TemplateModal.svelte component
  • Updated CollectionCard.svelte with dropdown menu options
  • New templates page with server-side data loading
  • Added CollectionTemplate type
  • Full i18n support for all 19 languages

Testing

Tested on Clever Cloud deployment.

Related Issue

Closes #1000

@wanoo wanoo requested a review from seanmorley15 as a code owner February 7, 2026 17:46
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 7, 2026

Someone is attempting to deploy a commit to the Sean Morley's Projects Team on Vercel.

A member of the Team first needs to authorize it.

@wanoo wanoo force-pushed the feature/duplicate-template branch from 887dc17 to 56a4b71 Compare February 7, 2026 17:49
seanmorley15 and others added 3 commits February 14, 2026 14:09
…rley15#991, seanmorley15#617, seanmorley15#984) (seanmorley15#1007)

* fix: resolve location creation failures, broken image uploads, and invalid URL handling

- Add missing addToast import in LocationDetails.svelte for proper error feedback
- Add objectId check and error response handling in ImageManagement.svelte to prevent ghost images
- Add Content-Type check in +page.server.ts image action to handle non-JSON backend responses
- Add client-side URL validation in LocationDetails.svelte (invalid URLs → null)
- Improve Django field error extraction for user-friendly toast messages
- Clean up empty description fields (whitespace → null)
- Update BUGFIX_DOCUMENTATION.md with detailed fix descriptions

* feat: bug fixes and new features bundle

Bug fixes:
- fix: resolve PATCH location with visits (seanmorley15#888)
- fix: Wikipedia/URL image upload via server-side proxy (seanmorley15#991)
- fix: private/public toggle race condition (seanmorley15#617)
- fix: location creation feedback (addToast import)
- fix: invalid URL handling for locations and collections
- fix: world map country highlighting (bg-*-200 -> bg-*-400)
- fix: clipboard API polyfill for HTTP contexts
- fix: MultipleObjectsReturned for duplicate images
- fix: SvelteKit proxy sessionid cookie forwarding

Features:
- feat: duplicate location button (list + detail view)
- feat: duplicate collection button
- feat: i18n translations for 19 languages
- feat: improved error handling and user feedback

Technical:
- Backend: fetch_from_url endpoint with SSRF protection
- Backend: validate_link() for collections
- Backend: file_permissions filter() instead of get()
- Frontend: copyToClipboard() helper function
- Frontend: clipboard polyfill via server-side injection

* chore: switch docker-compose from image to build

Use local source code builds instead of upstream :latest images
to preserve our custom patches and fixes.

* fix: lodging save errors, AI language support, and i18n improvements

- Fix Lodging save: add res.ok checks, error toasts, isSaving state (seanmorley15#984)
- Fix URL validation: silently set invalid URLs to null (Lodging, Transportation)
- Fix AI description language: pass user locale to Wikipedia API
- Fix missing i18n keys: Strava toggle buttons (show/hide)
- Add CHANGELOG.md
- Remove internal documentation from public tracking
- Update .gitignore for Cursor IDE and internal docs

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: update location duplication handling, improve UI feedback, and enhance localization support

---------

Co-authored-by: AdventureLog Bugfix <bugfix@adventurelog.local>
Co-authored-by: madmp87 <info@so-pa.de>
Co-authored-by: Mathias Ponnwitz <devuser@dockge-dev.fritz.box>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Sean Morley <mail@seanmorley.com>
@wanoo wanoo force-pushed the feature/duplicate-template branch from 56a4b71 to df71c04 Compare February 16, 2026 18:58
wanoo and others added 3 commits February 17, 2026 01:05
Enable shared editing of public locations across users with audit logging
and permission controls.

- Public locations can be edited by any authenticated user
- Users can only edit/delete their own visits, images, and attachments
- Location owner retains full control

- Track all changes to locations, visits, images, and attachments
- Record who made changes and when
- View modification history in UI
- Revert to previous versions

- Images and attachments use soft-delete
- Deleted items can be restored
- Track who deleted items and when

- View complete history of location changes
- See who made each modification
- Revert unwanted changes (for owner/staff)

Set COLLABORATIVE_MODE=true in environment to enable.
When disabled, permissions work as before.
…tings, pricing

- Expand Visit model: support Transportation/Lodging parents, rating, pricing, collection link
- Add admin-managed types: TransportationType, LodgingType, AdventureType, ActivityType with seed data
- Convert Transportation/Lodging collections from FK to M2M, add tags support
- Add country FK fields to Transportation (origin/dest) and Lodging
- Add cached average_rating to Location, Transportation, Lodging
- Default is_public=True on all entities
- Add 52 shared frontend components (modal, form, cards, detail, list)
- Refactor entity modals, details, and visits to use shared base components
- Add entity list pages with filters, sorting, and public tab
- Update cards with visit count, tags, rating, last visit date
- Add dashboard stats (total km, nights, places)
- Add collection enhancements (public tab, sharing, broken items, recommendations)
- Sync all i18n translations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add country currency fields and ExchangeRate model to worldtravel
- Add CollectionTemplate model for reusable trip templates
- Add template CRUD endpoints and frontend pages
- Add CurrencyDropdown, MoneyInput, and price badge components
- Add unified LocationSearchMap with reverse geocode integration
- Add exchange rates store and money formatting utilities
- Add AvgPriceBadge and PriceTierBadge shared card components
- Default public_profile=True for users

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants