Add 19 trails and 20 tracks, record stated permission, and remove the C&O Canal Towpath
A deeper, region-by-region search of the web added 14 official trails and 4 routes. The Hoosier Heritage Trail was added at its association's request (issue 2) with the association's own track, shared by written permission. - New licence value `stated-permission`, with the quoted words, who gave them, when and where as fields of the record, shown on the trail page and carried in the GPX description. - Tracks from OpenStreetMap or the Forest Service's open trail data for eleven of the new trails and seven existing ones. `tools/osm_track.py` can join several relations and leave ways out by name. - The C&O Canal Towpath is removed: the rule leaves out canal towpaths. - The Grand Enchantment Trail is recorded as a route by its author, with no track. - Corrections to the Finger Lakes, Ozark Highlands, Eastern Continental and Knobstone records, checked against the pages they cite. - Site: the list pages' own units switch is gone in favour of the header one; the map switch and a swapped length range stay in step with the page. - CHANGELOG.md brought up to date from the site's opening to today. 204 trails: 147 official trails and 57 routes; 126 have a track. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
c11a72a7dd
commit
d34a9617cd
127 files changed
+2612
-358
No files matched your search
+4
-1
@@ -411,12 +411,15 @@ def line_licence_rows(records, repo_root):
|
||||
recs = by_licence[lic]
|
||||
label = words.label(words.LICENCES, lic)
|
||||
n = len(recs)
|
||||
what = f"Tracks licensed {esc(label)}: {n} record{'s' if n != 1 else ''}"
|
||||
what = (f"Tracks shared with permission: {n} record{'s' if n != 1 else ''}" if lic == "stated-permission"
|
||||
else f"Tracks licensed {esc(label)}: {n} record{'s' if n != 1 else ''}")
|
||||
if n <= 3:
|
||||
links = ", ".join(f'<a href="{esc(common.trail_path(r))}">{common.name(r)}</a>' for r in recs)
|
||||
what += f" ({links})"
|
||||
what = Markup(what)
|
||||
terms = Markup(f'{esc(label)} <code class="raw">{esc(lic)}</code>; credit as named in each record and its release.txt')
|
||||
if lic in words.LICENCE_NOTES:
|
||||
terms = Markup(f'{esc(words.LICENCE_NOTES[lic])} <code class="raw">{esc(lic)}</code>; credit as named in each record and its release.txt')
|
||||
rows.append((what, terms, _licence_text_url(lic, repo_root)))
|
||||
return rows
|
||||
|
||||
|
||||
+15
-2
@@ -265,13 +265,26 @@ def _num(v):
|
||||
|
||||
|
||||
def gpx_text(parts, name, url="", attribution="", licence="", licence_text="",
|
||||
creator="long-trails dataset"):
|
||||
"""GPX 1.1 with one <trk> and one <trkseg> per part."""
|
||||
creator="long-trails dataset", permission=None):
|
||||
"""GPX 1.1 with one <trk> and one <trkseg> per part.
|
||||
|
||||
`permission` is the source's stated-permission fields (permission_quote, permission_by,
|
||||
permission_date, permission_url) when the licence is stated-permission."""
|
||||
desc = []
|
||||
if attribution:
|
||||
desc.append(f"Attribution: {attribution}")
|
||||
if licence_text:
|
||||
desc.append(f"Licence: {licence_text}")
|
||||
if permission and permission.get("permission_quote"):
|
||||
said = f'Permission: "{permission["permission_quote"]}"'
|
||||
if permission.get("permission_by"):
|
||||
said += f" Said by {permission['permission_by']}"
|
||||
if permission.get("permission_date"):
|
||||
said += f" on {permission['permission_date']}"
|
||||
said += "."
|
||||
if permission.get("permission_url"):
|
||||
said += f" Read at {permission['permission_url']}"
|
||||
desc.append(said)
|
||||
elif licence:
|
||||
desc.append(f"Licence: {licence}")
|
||||
out = [
|
||||
|
||||
+1
-9
@@ -371,14 +371,6 @@ def list_head(sort_key="name"):
|
||||
</div>"""
|
||||
|
||||
|
||||
UNITS_TOGGLE = """<fieldset class="results-units">
|
||||
<legend class="vh">Lengths</legend>
|
||||
<div class="seg seg--small">
|
||||
<label><input type="radio" name="units-list" value="mi" checked><span>mi</span></label>
|
||||
<label><input type="radio" name="units-list" value="km"><span>km</span></label>
|
||||
</div>
|
||||
</fieldset>"""
|
||||
|
||||
# The order a saved list was made in: offered first on the Saved page only,
|
||||
# where app.js numbers the rows (data-order) in the order they were saved.
|
||||
SAVED_ORDER = ("saved", "Order saved")
|
||||
@@ -470,7 +462,7 @@ def results(recs=None, *, finder=False, groups=None, routes_list=False, default_
|
||||
else:
|
||||
count = f'<p class="results-count"><strong>{total}</strong> {noun}</p>'
|
||||
empty = ""
|
||||
tools = sort_select(default_sort, saved=saved) + "\n " + UNITS_TOGGLE
|
||||
tools = sort_select(default_sort, saved=saved)
|
||||
dflt = SAVED_ORDER[0] if saved else default_sort
|
||||
return Markup(f"""<div class="results" data-sortable data-default-sort="{esc(dflt)}">
|
||||
<div class="results-head">
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ THEMES = (("auto", "Auto"), ("light", "Light"), ("dark", "Dark"))
|
||||
def prefs():
|
||||
"""The reader's two display choices, at the right of the header on every page.
|
||||
|
||||
Units: a two-way switch, mi or km first (radios named "units", as every
|
||||
Units: a two-way switch, mi or km first (radios named "units", the only
|
||||
units switch on the site; app.js keeps them in step and fires olt:units).
|
||||
Theme: a small menu built from <details>, its button showing the theme in
|
||||
use (its icon, and its name where there is room); the menu holds the three
|
||||
|
||||
+15
-2
@@ -575,6 +575,8 @@ def downloads_panel(rec):
|
||||
licence_html = Markup(f'{licence_html}; OpenStreetMap parts {ext_link(words.LICENCE_URLS["ODbL-1.0"], "ODbL 1.0")}')
|
||||
osm_note = ("<p class=\"note\">Tracks from OpenStreetMap need the credit “© OpenStreetMap contributors” "
|
||||
"and stay under the ODbL (share-alike).</p>") if "ODbL" in src.get("attribution", "") + licence else ""
|
||||
licence_note = (f'<p class="note">{esc(words.LICENCE_NOTES[licence])}</p>'
|
||||
if licence in words.LICENCE_NOTES else "")
|
||||
release = (f'<p class="note"><a href="/trails/{esc(rec["id"])}/release.txt">release.txt</a>: '
|
||||
f"the source, licence and date the track files came from.</p>"
|
||||
if rec["derived"].get("release") else "")
|
||||
@@ -592,7 +594,7 @@ def downloads_panel(rec):
|
||||
<button class="button button--quiet" type="button" data-copy="#credit-text" data-copy-status="#credit-done" aria-describedby="credit-label" hidden>Copy credit</button>
|
||||
</div>
|
||||
<p class="credit__done" id="credit-done" role="status"></p>
|
||||
{osm_note}
|
||||
{osm_note}{licence_note}
|
||||
</div>
|
||||
{release}
|
||||
</div>
|
||||
@@ -971,7 +973,18 @@ def source_block(rec):
|
||||
]
|
||||
if src.get("decision") or src.get("decision_text"):
|
||||
rows.append(fact("Decision", src.get("decision_text", "") or words.DECISIONS.get(src.get("decision", ""), src.get("decision", ""))))
|
||||
licence_text = (f'<h3 class="block__sub">What the source says</h3>{record_text(src["licence_text"])}'
|
||||
licence_note = (f'<p>{esc(words.LICENCE_NOTES[licence])}</p>' if licence in words.LICENCE_NOTES else "")
|
||||
permission = ""
|
||||
if licence == "stated-permission" and src.get("permission_quote"):
|
||||
url = src.get("permission_url", "")
|
||||
permission = f"""<figure class="quote">
|
||||
<blockquote{f' cite="{esc(url)}"' if url else ""}><p>{esc(src["permission_quote"])}</p></blockquote>
|
||||
<figcaption>
|
||||
<p class="quote__who">Said by {esc(src.get("permission_by", ""))} on {esc(src.get("permission_date", ""))}.</p>
|
||||
{f'<p>Read at {ext_link(url)}.</p>' if url else ""}
|
||||
</figcaption>
|
||||
</figure>"""
|
||||
licence_text = (f'<h3 class="block__sub">What the source says</h3>{licence_note}{Markup(permission)}{record_text(src["licence_text"])}'
|
||||
'<p class="note">With the page it was read on. Not legal advice.</p>') if src.get("licence_text") else ""
|
||||
return block("source-title", "Source and licence", facts(*rows) + Markup(licence_text))
|
||||
|
||||
|
||||
@@ -64,11 +64,17 @@ LICENCES = {
|
||||
"CC-BY-4.0": "CC BY 4.0",
|
||||
"CC-BY": "CC BY",
|
||||
"ODbL-1.0": "ODbL 1.0",
|
||||
"stated-permission": "Shared with permission",
|
||||
"CC-BY-NC-ND-4.0": "CC BY-NC-ND 4.0",
|
||||
"none-stated": "None stated",
|
||||
"restricted": "Restricted",
|
||||
"unknown": "Unknown",
|
||||
}
|
||||
LICENCE_NOTES = {
|
||||
"stated-permission": ("Shared with permission. The holder has said in writing that this track may be "
|
||||
"shared; the statement is quoted below. It is not public domain and not a "
|
||||
"Creative Commons licence."),
|
||||
}
|
||||
LICENCE_URLS = {
|
||||
"us-gov-public-domain": "https://www.usa.gov/government-works",
|
||||
"CC-BY-4.0": "https://creativecommons.org/licenses/by/4.0/",
|
||||
|
||||
Reference in new issue
Block a user