27 lines
871 B
Python
27 lines
871 B
Python
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")
|