|
22 | 22 | {% endmacro %} |
23 | 23 |
|
24 | 24 | {% macro note_link(typ, id, text="add new note") %} |
25 | | -<a href="{{ url_for('note_obj', typ=typ, id=id) }}"><button>{{ text }}</button></a> |
| 25 | +<a href="{{ url_for('note_obj', typ=typ, id=id) }}" hx-boost="true" preload="preload:init"><button>{{ text }}</button></a> |
26 | 26 | {% endmacro %} |
27 | 27 |
|
28 | 28 | {% macro turf_link(t) %} |
|
35 | 35 |
|
36 | 36 | {% macro door_link(d, turf=None) %} |
37 | 37 | {% with door = db.get_door_by_id(d), disp = db.get_disposition_for_type_and_id("door", d, turf) %} |
38 | | -<a href="{{ url_for('show_door', id=d) }}"{% if turf %} data-disposition="{{ disp }}"{% endif %}> |
| 38 | +<a {% if session.sports_car|default(false) %}preload="preload:init"{% endif %} href="{{ url_for('show_door', id=d) }}"{% if turf %} data-disposition="{{ disp }}"{% endif %}> |
39 | 39 | {{ door.address }}{% if door.unit %} – {{ door.unit }}{% endif %} |
40 | 40 |
|
41 | 41 | {% if turf and disp %}<span class="disposition">({{ dispositions[disp] }})</span>{% endif %} |
|
46 | 46 | {% macro voter_link(v, turf=None) %} |
47 | 47 | {% with voter = db.get_voter_by_id(v) %} |
48 | 48 | {% with d = db.get_disposition_for_type_and_id("voter", v, turf) %} |
49 | | -<a href="{{ url_for('show_voter', id=v) }}" data-disposition="{{ d }}"> |
| 49 | +<a preload="preload:init" href="{{ url_for('show_voter', id=v) }}" data-disposition="{{ d }}"> |
50 | 50 | {{ voter.firstname }} {{ voter.middlename }} {{ voter.lastname }} |
51 | 51 | {{ render_disposition(d) }} |
52 | 52 | </a> |
|
74 | 74 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
75 | 75 | <link rel="stylesheet" href="/static/mycoolstylesheet.css"> |
76 | 76 |
|
| 77 | + <script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js" integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz" crossorigin="anonymous"></script> |
| 78 | + <script src="https://cdn.jsdelivr.net/npm/htmx-ext-preload@2.1.2" integrity="sha384-PRIcY6hH1Y5784C76/Y8SqLyTanY9rnI3B8F3+hKZFNED55hsEqMJyqWhp95lgfk" crossorigin="anonymous"></script> |
| 79 | + |
77 | 80 | <!-- cribbed from rose, thank u hunter <3 --> |
78 | 81 | <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" |
79 | 82 | integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" |
|
86 | 89 | <script src="https://cdn.jsdelivr.net/npm/leaflet.locatecontrol/dist/L.Control.Locate.min.js" charset="utf-8"></script> |
87 | 90 | <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> |
88 | 91 | </head> |
89 | | - <body> |
| 92 | + <body hx-ext="preload"> |
90 | 93 | <header> |
91 | 94 | {% if session.canvasser %} |
92 | 95 | Hi, {{ session.canvasser }}! · |
|
129 | 132 |
|
130 | 133 | <a href="/autolink_toggle/?return={{ request.url|urlencode }}"> |
131 | 134 | {% if session.autolink|default(True) %}disable{% else %}enable{% endif %} door links to gmaps |
132 | | - </a> |
| 135 | + </a> · |
133 | 136 |
|
| 137 | + <a href="/sportscar_toggle/?return={{ request.url|urlencode }}"> |
| 138 | + {% if session.sports_car|default(False) %}switch to normal car{% else %}switch to sports car{% endif %} |
| 139 | + </a> |
134 | 140 | <br /> |
135 | 141 | {% endif %} |
136 | 142 | <a target="_blank" class="credits-link" href="/credits/">🚗 car by Tris and friends</a> |
|
0 commit comments