Show destinations as one-click cards
This commit is contained in:
parent
945d028c13
commit
a9d5a0589d
2 changed files with 102 additions and 16 deletions
|
|
@ -4,33 +4,41 @@
|
|||
<h2 style="margin-top:0">Plan your journey</h2>
|
||||
<form method="get" action="{{ url_for('search') }}">
|
||||
<div style="margin-bottom:1.2rem">
|
||||
<label for="destination" style="display:block;font-weight:600;margin-bottom:0.4rem">
|
||||
Eurostar destination
|
||||
</label>
|
||||
<select id="destination" name="destination" required
|
||||
style="width:100%;padding:0.6rem 0.8rem;font-size:1rem;border:1px solid #cbd5e0;border-radius:4px">
|
||||
<option value="" disabled selected>Select destination…</option>
|
||||
<span class="field-label">Eurostar destination</span>
|
||||
<div class="destination-grid" role="radiogroup" aria-label="Eurostar destination">
|
||||
{% for slug, name in destinations.items() %}
|
||||
<option value="{{ slug }}">{{ name }}</option>
|
||||
{% set city = name.replace(' Gare du Nord', '').replace(' Centraal', '').replace(' Midi', '').replace(' Europe', '') %}
|
||||
<div class="destination-option">
|
||||
<input
|
||||
type="radio"
|
||||
id="destination-{{ slug }}"
|
||||
name="destination"
|
||||
value="{{ slug }}"
|
||||
{% if loop.first %}checked{% endif %}
|
||||
required>
|
||||
<label for="destination-{{ slug }}">
|
||||
<strong>{{ city }}</strong>
|
||||
<span>{{ name }}</span>
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:1.5rem">
|
||||
<label for="travel_date" style="display:block;font-weight:600;margin-bottom:0.4rem">
|
||||
<label for="travel_date" class="field-label">
|
||||
Travel date
|
||||
</label>
|
||||
<input type="date" id="travel_date" name="travel_date" required
|
||||
min="{{ today }}" value="{{ today }}"
|
||||
style="width:100%;padding:0.6rem 0.8rem;font-size:1rem;border:1px solid #cbd5e0;border-radius:4px">
|
||||
class="form-control">
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:1.2rem">
|
||||
<label for="min_connection" style="display:block;font-weight:600;margin-bottom:0.4rem">
|
||||
<label for="min_connection" class="field-label">
|
||||
Minimum connection time (Paddington → St Pancras)
|
||||
</label>
|
||||
<select id="min_connection" name="min_connection"
|
||||
style="width:100%;padding:0.6rem 0.8rem;font-size:1rem;border:1px solid #cbd5e0;border-radius:4px">
|
||||
<select id="min_connection" name="min_connection" class="form-control">
|
||||
{% for mins in [50, 60, 70, 80, 90, 100, 110, 120] %}
|
||||
<option value="{{ mins }}" {% if mins == 50 %}selected{% endif %}>{{ mins }} min</option>
|
||||
{% endfor %}
|
||||
|
|
@ -38,11 +46,10 @@
|
|||
</div>
|
||||
|
||||
<div style="margin-bottom:1.5rem">
|
||||
<label for="max_connection" style="display:block;font-weight:600;margin-bottom:0.4rem">
|
||||
<label for="max_connection" class="field-label">
|
||||
Maximum connection time (Paddington → St Pancras)
|
||||
</label>
|
||||
<select id="max_connection" name="max_connection"
|
||||
style="width:100%;padding:0.6rem 0.8rem;font-size:1rem;border:1px solid #cbd5e0;border-radius:4px">
|
||||
<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] %}
|
||||
<option value="{{ mins }}" {% if mins == 110 %}selected{% endif %}>{{ mins }} min</option>
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue