"""The Saved page, /saved/: the visitor's saved trails, or a list opened from a link. Saved trails are kept in the visitor's browser only: localStorage, key lh-saved, the trail ids in the order saved (app.js). A link carries a list in its own address, /saved/?t=,,..., so it opens the same list on any device, in any browser, with nothing remembered. The page is written like every other, so it cannot know the list. It holds every trail's row, hidden (the same rows as the catalogue, about as heavy as the home page's list; the hidden rows' logos are not fetched), and app.js (initSavedPage) shows the right ones: own list no t= in the address: the visitor's saved trails, the map of them, and the link to them with a Copy link button nothing saved no t=, nothing saved: how to save a trail, and a link to the trails from a link t= in the address: that list, marked as from a link, with "Save these" (adds it to the visitor's own) and a way to their own list; ids that match no trail are dropped and counted. A link holding the visitor's own list is shown as theirs. Without JavaScript the page says that saved trails need it. It is not indexed (layout noindex) and not in the sitemap (seo.all_paths). """ from . import common, home from .markup import Markup PATH = "/saved/" TITLE = "Saved trails" DESCRIPTION = "The trails you saved, kept in this browser, and a link that opens the same list anywhere." def saved_page(records, site): """(title, description, body) for /saved/.""" recs = sorted(records, key=home.sort_name) star = common.ICON_STAR body = f"""

{TITLE}

Trails you save are kept here, in this browser on this device.

Saved trails need JavaScript, which is off or blocked in this browser. See every trail.

""" return TITLE, DESCRIPTION, Markup(body)