auto-sync: 2026-05-13 16:30:01
This commit is contained in:
26
tasks/enduro-trails/scripts/patch_trails_html.py
Normal file
26
tasks/enduro-trails/scripts/patch_trails_html.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
|
||||
path = "/home/slin/enduro-trails/prototype/static/index.html"
|
||||
with open(path, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
# Insert after line 46 (0-indexed: 45) which is </label> for terrain-tri
|
||||
insert_after = 45
|
||||
new_lines = [
|
||||
' <hr style="margin:6px 0;border-color:rgba(128,128,128,0.3)">\n',
|
||||
' <label class="terrain-checkbox">\n',
|
||||
' <input type="checkbox" id="trails-track-cb" onchange="onTrailsCheckbox()" checked>\n',
|
||||
' <span>Грунтовки</span>\n',
|
||||
' </label>\n',
|
||||
' <label class="terrain-checkbox">\n',
|
||||
' <input type="checkbox" id="trails-path-cb" onchange="onTrailsCheckbox()" checked>\n',
|
||||
' <span>Тропы</span>\n',
|
||||
' </label>\n',
|
||||
]
|
||||
|
||||
lines = lines[:insert_after+1] + new_lines + lines[insert_after+1:]
|
||||
|
||||
with open(path, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
print("OK - inserted trails checkboxes")
|
||||
Reference in New Issue
Block a user