feat(tours): keep whole tours in collections and take them into trips

A saved tour can now be kept in a collection, apart from any trip, and
later made into a tour of another trip. The bookmark button in a tour's
footer and in the planner's head (waiting for the save while there are
unsaved changes) opens a dialog with every list of the user; a list they
may only read stays in it, dimmed with a lock and a tooltip. The list
keeps an independent copy: the line, the type, every measure and setting,
the waypoints in order with their roles, the origin, and the trip and tour
it was saved from as they were called then. Its days, its links to places
of the trip and its obstacle decisions stay in the trip, and later changes
to the tour do not reach the copy.

A collection shows its kept tours as cards above its places: the grade
tile with the source badge, measures and the waypoint count as badges,
the trip it came from, and who kept it. The owner or an admin of the list
can remove one after a question; tours made from it stay. "Add to a trip"
shows the kept tour on a map with its facts and numbered waypoints, lists
the user's trips (the ones they may not add tours to dimmed), and asks
outright whether the waypoints come along. "Line only" keeps the line as
saved and adds no waypoints; a tour kept without a line can only bring
them. The new tour has an id of its own, no days and no new places, and
names the trip and tour it was saved from; the dialog then offers to open
that trip. Neither the collection nor the original tour changes.

On the server the kept tours are a table of their own in the tours domain
(collection_tours, migration 046100), each row written whole once. Every
copy, the in-trip "save as new tour", the take-over from another trip and
both directions here, now goes through one copy model (tour-copy.helpers)
instead of a second one. Reading and removing follow the collection's
roles, keeping one also needs access to the source trip, and taking one
over needs place_edit on the target trip; the kept tour is read again
inside the write, so one removed meanwhile leaves no half-made tour. The
MCP tools list_collection_tours, get_collection_tour,
save_tour_to_collection, take_over_collection_tour and
delete_collection_tour run over the same service and checks. All 27
locales carry the new strings, and the wiki describes the flow.
This commit is contained in:
Maurice
2026-10-20 13:15:42 +02:00
parent 3659297af1
commit 3fe34061fd
85 changed files with 6144 additions and 181 deletions
+43
View File
@@ -1334,5 +1334,48 @@ const tours: TranslationStrings = {
'tours.stages.wholeTour': 'Tour completo',
'tours.stages.totalPartial': 'noto per {known} tappe su {of}',
'tours.stages.openInPlanner': 'Apri questa tappa nel pianificatore',
'tours.collection.save': 'Tieni in una raccolta',
'tours.collection.saveHint': 'Tiene una copia indipendente di questo percorso in una delle tue raccolte',
'tours.collection.saveFirst': 'Salva prima il percorso per tenerlo in una raccolta',
'tours.collection.saveSub': 'Una copia indipendente. Le modifiche successive a questo percorso non la raggiungono.',
'tours.collection.list': 'Raccolta',
'tours.collection.readOnly': 'Puoi solo leggere questa lista',
'tours.collection.noLists': 'Non hai ancora nessuna raccolta.',
'tours.collection.openCollections': 'Apri le raccolte',
'tours.collection.nameThere': 'Nome nella raccolta',
'tours.collection.keep': 'Tieni',
'tours.collection.kept': '“{name}” ora è tenuto in “{list}”.',
'tours.collection.keepFailed': 'Non è stato possibile tenere il percorso.',
'tours.collection.offline': 'Le raccolte hanno bisogno di una connessione.',
'tours.collection.listsFailed': 'Non è stato possibile caricare le raccolte.',
'tours.collection.toursFailed': 'Non è stato possibile caricare i percorsi di questa lista.',
'tours.collection.points': '{count} punti di passaggio',
'tours.collection.points.one': '{count} punto di passaggio',
'tours.collection.savedFrom': 'Tenuto da',
'tours.collection.source': 'Tenuto da “{tour}” in “{trip}”',
'tours.collection.keptBy': 'Tenuto da {name}',
'tours.collection.add': 'Aggiungi a un viaggio',
'tours.collection.addHint': 'Crea un nuovo percorso a sé nel viaggio che scegli',
'tours.collection.remove': 'Togli dalla raccolta',
'tours.collection.removeTitle': 'Togliere questo percorso dalla raccolta?',
'tours.collection.removeBody': 'I percorsi già creati da questo nei tuoi viaggi restano come sono.',
'tours.collection.removed': 'Il percorso è stato tolto dalla raccolta.',
'tours.collection.removeFailed': 'Non è stato possibile togliere il percorso.',
'tours.collection.takeEyebrow': 'Dalla raccolta',
'tours.collection.takeSub': 'Diventa un percorso a sé nel viaggio scelto, senza giorni. La raccolta resta com’è.',
'tours.collection.intoTrip': 'Nel viaggio',
'tours.collection.noPermission': 'Non puoi aggiungere percorsi a questo viaggio',
'tours.collection.noTrips': 'Non hai ancora nessun viaggio a cui aggiungerlo.',
'tours.collection.withPoints': 'Con {count} punti di passaggio',
'tours.collection.withPoints.one': 'Con {count} punto di passaggio',
'tours.collection.withPointsHint': 'Partenza, tappe e arrivo seguono nel loro ordine.',
'tours.collection.lineOnly': 'Solo la linea',
'tours.collection.lineOnlyHint': 'La linea resta come è stata salvata. Nessun punto di passaggio viene aggiunto.',
'tours.collection.needsPoints':
'Questo percorso non ha ancora una linea, quindi i suoi punti di passaggio devono seguire.',
'tours.collection.nameInTrip': 'Nome nel viaggio',
'tours.collection.taken': '“{name}” ora è un percorso di “{trip}”.',
'tours.collection.takeFailed': 'Non è stato possibile aggiungere il percorso al viaggio.',
'tours.collection.openTrip': 'Apri il viaggio',
};
export default tours;