Sort every list of trails, and map trails that have no track
Sorting. Every list of trails has a "Sort by" menu: name, length, time or climb, each in both directions. Where the list is a table, the Trail, Length, Time and Climb heads sort on click and reverse on a second click. Lists open by name, A to Z, except the four that are defined by an order (the longest, under 100 km, a week or less, one to two weeks). The chosen order is kept in the page address. The pages are written in their default order, so they are right without JavaScript. Maps. A trail with no track but a known start and end is drawn as a dotted straight line between the two with a ring at each; one with a single known point is drawn as a ring. They follow the filters, the row highlight and the popup like any track, and that trail's own page shows a map in place of the empty frame. The legend, the caption and the popup say the dotted line is not the trail's path. It gives no download, no GPX status and no elevation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
d84116ce3a
commit
51baaa401e
15 files changed
+1049
-149
No files matched your search
+4
-4
@@ -123,7 +123,7 @@ def region_page(slug, records, site):
|
||||
</div>"""
|
||||
title = info["name"]
|
||||
desc = f"{_plural(len(recs))} in {info['name']}, {country}: length, time and where to get the GPX."
|
||||
return title, desc, Markup(body), n_gpx >= home.MAP_MIN
|
||||
return title, desc, Markup(body), home.has_overview_map(recs)
|
||||
|
||||
|
||||
def route_guides(rec):
|
||||
@@ -172,7 +172,7 @@ def routes_page(records, site, repo_root=None):
|
||||
{home.results(groups=groups, routes_list=True)}
|
||||
<nav class="region-nav" aria-label="Other lists"><a href="/lists/">All lists</a> · <a href="/">Every trail</a></nav>
|
||||
</div>"""
|
||||
return "Routes", f"{_plural(len(routes), 'route')} in the United States and Canada, by author, with their guides.", Markup(body), n_gpx >= home.MAP_MIN
|
||||
return "Routes", f"{_plural(len(routes), 'route')} in the United States and Canada, by author, with their guides.", Markup(body), home.has_overview_map(routes)
|
||||
|
||||
|
||||
def list_page(lst, recs, total, site):
|
||||
@@ -192,11 +192,11 @@ def list_page(lst, recs, total, site):
|
||||
</div></div>
|
||||
<div class="container section">
|
||||
{home.overview_map(recs, f"Map of the trails in the list {lst.title}")}
|
||||
{home.results(recs)}
|
||||
{home.results(recs, default_sort=lst.sort)}
|
||||
<p class="finder__foot">{rule}</p>
|
||||
<nav class="region-nav" aria-label="Other lists"><a href="/lists/">All lists</a> · <a href="/">Every trail</a></nav>
|
||||
</div>"""
|
||||
return lst.title, f"{lst.title}: {lst.blurb}", Markup(body), n_gpx >= home.MAP_MIN
|
||||
return lst.title, f"{lst.title}: {lst.blurb}", Markup(body), home.has_overview_map(recs)
|
||||
|
||||
|
||||
def lists_index_page(records, site):
|
||||
|
||||
Reference in new issue
Block a user