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
+44
View File
@@ -1313,5 +1313,49 @@ const tours: TranslationStrings = {
'tours.stages.wholeTour': 'Celá trasa',
'tours.stages.totalPartial': 'známo pro {known} z {of} etap',
'tours.stages.openInPlanner': 'Otevřít tuto etapu v plánovači',
'tours.collection.save': 'Uložit do sbírky',
'tours.collection.saveHint': 'Uloží nezávislou kopii této túry do jedné z tvých sbírek',
'tours.collection.saveFirst': 'Nejprve túru ulož, abys ji mohl dát do sbírky',
'tours.collection.saveSub': 'Nezávislá kopie. Pozdější změny této túry se jí nedotknou.',
'tours.collection.list': 'Sbírka',
'tours.collection.readOnly': 'Tento seznam můžeš jen číst',
'tours.collection.noLists': 'Zatím nemáš žádnou sbírku.',
'tours.collection.openCollections': 'Otevřít sbírky',
'tours.collection.nameThere': 'Název ve sbírce',
'tours.collection.keep': 'Uložit',
'tours.collection.kept': '„{name}“ je teď ve sbírce „{list}“.',
'tours.collection.keepFailed': 'Túru se nepodařilo uložit.',
'tours.collection.offline': 'Sbírky potřebují připojení.',
'tours.collection.listsFailed': 'Sbírky se nepodařilo načíst.',
'tours.collection.toursFailed': 'Túry tohoto seznamu se nepodařilo načíst.',
'tours.collection.points': '{count} bodů trasy',
'tours.collection.points.one': '{count} bod trasy',
'tours.collection.points.few': '{count} body trasy',
'tours.collection.savedFrom': 'Uloženo z',
'tours.collection.source': 'Uloženo z „{tour}“ v „{trip}“',
'tours.collection.keptBy': 'Uložil(a) {name}',
'tours.collection.add': 'Přidat do cesty',
'tours.collection.addHint': 'Vytvoří vlastní novou túru v cestě, kterou zvolíš',
'tours.collection.remove': 'Odebrat ze sbírky',
'tours.collection.removeTitle': 'Odebrat tuto túru ze sbírky?',
'tours.collection.removeBody': 'Túry, které už z ní ve tvých cestách vznikly, zůstanou, jak jsou.',
'tours.collection.removed': 'Túra byla odebrána ze sbírky.',
'tours.collection.removeFailed': 'Túru se nepodařilo odebrat.',
'tours.collection.takeEyebrow': 'Ze sbírky',
'tours.collection.takeSub': 'Stane se vlastní túrou zvolené cesty, bez dnů. Sbírka zůstane, jak je.',
'tours.collection.intoTrip': 'Do cesty',
'tours.collection.noPermission': 'Do této cesty nemůžeš přidávat túry',
'tours.collection.noTrips': 'Zatím nemáš žádnou cestu, kam ji přidat.',
'tours.collection.withPoints': 'S {count} body trasy',
'tours.collection.withPoints.one': 'S {count} bodem trasy',
'tours.collection.withPoints.few': 'Se {count} body trasy',
'tours.collection.withPointsHint': 'Start, zastávky a cíl přejdou ve svém pořadí.',
'tours.collection.lineOnly': 'Jen linie',
'tours.collection.lineOnlyHint': 'Linie zůstane, jak byla uložena. Žádné body trasy se nepřidají.',
'tours.collection.needsPoints': 'Tato túra zatím nemá linii, proto musí její body trasy přejít s ní.',
'tours.collection.nameInTrip': 'Název v cestě',
'tours.collection.taken': '„{name}“ je teď túrou cesty „{trip}“.',
'tours.collection.takeFailed': 'Túru se nepodařilo přidat do cesty.',
'tours.collection.openTrip': 'Otevřít cestu',
};
export default tours;