Drive search form dropdowns from VALID_MIN/MAX_CONNECTIONS; warn on short transfers
Index page connection time dropdowns now iterate over valid_min_connections
and valid_max_connections passed from the view, so any change to the sets
in app.py is reflected automatically (also adds the missing 45 min option).
Add ⚠️ next to transfer times under 80 minutes in the results table;
store connection_minutes in each trip dict to support the comparison.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
19656f412a
commit
e7695a5e49
4 changed files with 11 additions and 4 deletions
|
|
@ -47,7 +47,7 @@
|
|||
Minimum connection time (Paddington → St Pancras)
|
||||
</label>
|
||||
<select id="min_connection" name="min_connection" class="form-control">
|
||||
{% for mins in [50, 60, 70, 80, 90, 100, 110, 120] %}
|
||||
{% for mins in valid_min_connections %}
|
||||
<option value="{{ mins }}" {% if mins == 50 %}selected{% endif %}>{{ mins }} min</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
Maximum connection time (Paddington → St Pancras)
|
||||
</label>
|
||||
<select id="max_connection" name="max_connection" class="form-control">
|
||||
{% for mins in [60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180] %}
|
||||
{% for mins in valid_max_connections %}
|
||||
<option value="{{ mins }}" {% if mins == 110 %}selected{% endif %}>{{ mins }} min</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
<br><span style="font-size:0.75rem;color:#718096">{{ row.ticket_name }}</span>
|
||||
</td>
|
||||
<td class="col-transfer" style="padding:0.6rem 0.8rem;color:#4a5568">
|
||||
{{ row.connection_duration }}
|
||||
{{ row.connection_duration }}{% if row.connection_minutes < 80 %} ⚠️{% endif %}
|
||||
</td>
|
||||
<td style="padding:0.6rem 0.8rem;font-weight:600">
|
||||
{{ row.depart_st_pancras }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue