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
@@ -133,15 +133,17 @@ class ExtraPagesTest(unittest.TestCase):
|
||||
for rel in ("index.html", "regions/us-co/index.html", "routes/index.html",
|
||||
"lists/national-scenic-trails/index.html"):
|
||||
doc = read_out(rel)
|
||||
results = doc[doc.index('<div class="results">'):]
|
||||
results = doc[doc.index('<div class="results"'):]
|
||||
for part in ('<div class="list-head" aria-hidden="true">', '<ol class="entries"',
|
||||
'name="units-list"', '<ul class="key"'):
|
||||
'name="units-list"', '<ul class="key"', "Sort by", 'data-sort-select'):
|
||||
self.assertIn(part, results, f"{rel}: {part}")
|
||||
scale = re.search(r'<div class="list-head".*?</div>', results, re.S).group(0)
|
||||
self.assertEqual(scale.count('class="len__km"'), 3, rel)
|
||||
self.assertEqual(scale.count('class="len__mi"'), 3, rel)
|
||||
for name in ("Length", "Time", "GPX"):
|
||||
self.assertIn(f"<span>{name}", scale, rel)
|
||||
for name in ("Length", "Time", "GPX", "Climb"):
|
||||
self.assertIn(name, scale, rel)
|
||||
for col in ("name", "length", "time", "climb"):
|
||||
self.assertIn(f'data-sort-col="{col}"', scale, rel)
|
||||
self.assertNotIn('class="route-item"', read_out("routes/index.html"))
|
||||
|
||||
def test_routes_page_rows_carry_their_guides(self):
|
||||
|
||||
Reference in new issue
Block a user