From 2090268754db2559283852f37811c764faf2c1b2 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 30 Mar 2026 20:55:15 +0100 Subject: [PATCH] Various improvements --- app.py | 9 +++++++++ templates/index.html | 10 +--------- templates/results.html | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app.py b/app.py index 2329d42..7fef309 100644 --- a/app.py +++ b/app.py @@ -33,6 +33,15 @@ def index(): return render_template('index.html', destinations=DESTINATIONS, today=today) +@app.route('/search') +def search(): + slug = request.args.get('destination', '') + travel_date = request.args.get('travel_date', '') + if slug in DESTINATIONS and travel_date: + return redirect(url_for('results', slug=slug, travel_date=travel_date)) + return redirect(url_for('index')) + + @app.route('/results//') def results(slug, travel_date): destination = DESTINATIONS.get(slug) diff --git a/templates/index.html b/templates/index.html index d9d0dc4..5f92c52 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,7 +2,7 @@ {% block content %}

Plan your journey

-
+
- {% endblock %} diff --git a/templates/results.html b/templates/results.html index 661c3f1..5f6d440 100644 --- a/templates/results.html +++ b/templates/results.html @@ -2,7 +2,7 @@ {% block content %}

- ← New search + ← New search

@@ -10,11 +10,11 @@ Bristol Temple Meads → {{ destination }}
- ← Prev {{ travel_date_display }} - Next →