Add same-day destination switcher to results
This commit is contained in:
parent
c3d289e809
commit
143887d482
3 changed files with 49 additions and 0 deletions
1
app.py
1
app.py
|
|
@ -121,6 +121,7 @@ def results(slug, travel_date):
|
||||||
return render_template(
|
return render_template(
|
||||||
'results.html',
|
'results.html',
|
||||||
trips=trips,
|
trips=trips,
|
||||||
|
destinations=DESTINATIONS,
|
||||||
destination=destination,
|
destination=destination,
|
||||||
travel_date=travel_date,
|
travel_date=travel_date,
|
||||||
slug=slug,
|
slug=slug,
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,39 @@
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chip-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-link,
|
||||||
|
.chip-current {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.35rem 0.8rem;
|
||||||
|
border: 1px solid #cbd5e0;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-link {
|
||||||
|
color: #00539f;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-link:hover {
|
||||||
|
border-color: #7aa7d9;
|
||||||
|
background: #f8fbff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-current {
|
||||||
|
color: #fff;
|
||||||
|
background: #00539f;
|
||||||
|
border-color: #00539f;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.card {
|
.card {
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,21 @@
|
||||||
style="padding:0.3rem 0.75rem;border:1px solid #cbd5e0;border-radius:4px;
|
style="padding:0.3rem 0.75rem;border:1px solid #cbd5e0;border-radius:4px;
|
||||||
text-decoration:none;color:#00539f;font-size:0.9rem">Next →</a>
|
text-decoration:none;color:#00539f;font-size:0.9rem">Next →</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin:0.9rem 0 1rem">
|
||||||
|
<div style="font-size:0.9rem;font-weight:600;margin-bottom:0.45rem">Switch destination for {{ travel_date_display }}</div>
|
||||||
|
<div class="chip-row">
|
||||||
|
{% for destination_slug, destination_name in destinations.items() %}
|
||||||
|
{% if destination_slug == slug %}
|
||||||
|
<span class="chip-current">{{ destination_name }}</span>
|
||||||
|
{% else %}
|
||||||
|
<a
|
||||||
|
class="chip-link"
|
||||||
|
href="{{ url_for('results', slug=destination_slug, travel_date=travel_date, min_connection=min_connection, max_connection=max_connection) }}"
|
||||||
|
>{{ destination_name }}</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div style="margin-top:0.75rem;display:flex;gap:1.5rem;align-items:center">
|
<div style="margin-top:0.75rem;display:flex;gap:1.5rem;align-items:center">
|
||||||
<div>
|
<div>
|
||||||
<label for="min_conn_select" style="font-size:0.9rem;font-weight:600;margin-right:0.5rem">
|
<label for="min_conn_select" style="font-size:0.9rem;font-weight:600;margin-right:0.5rem">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue