From 5c546cc2ece7598ae98984fe91b426ef0236dda4 Mon Sep 17 00:00:00 2001 From: altf4arnold Date: Wed, 20 Mar 2024 18:06:41 +0100 Subject: [PATCH] starts to look nice --- app.py | 2 +- static/style.css | 5 +++++ templates/screen.html | 52 +++++++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/app.py b/app.py index 1a9bc2a..de49a4d 100644 --- a/app.py +++ b/app.py @@ -44,7 +44,7 @@ def hello_world(): flight["departure_delay"] = delay.strftime(localformat) if negative: flight["departure_delay"] = ("-" + str(flight["departure_delay"])) - return render_template('screen.html', airport=airport, data=rawdata) + return render_template('screen.html', len=len(rawdata), airport=airport, flight=rawdata) @app.route("/style.css") diff --git a/static/style.css b/static/style.css index b9e3359..dafd400 100644 --- a/static/style.css +++ b/static/style.css @@ -600,6 +600,11 @@ video { border-bottom-width: 1px; } +.bg-gray-100 { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); diff --git a/templates/screen.html b/templates/screen.html index 6dc0fc1..dded025 100644 --- a/templates/screen.html +++ b/templates/screen.html @@ -34,31 +34,35 @@ - {% for flight in data %} - - {{ flight["ident"] }} - {{ flight["scheduled_off"] }} - {% if flight["departure_delay"] %} - {{ flight["departure_delay"] }} - {% else %} - {% endif %} - - {{ flight["operator"] }} - - {% if flight["destination"]["name"] %} - {{ flight["destination"]["name"] }} - {{ flight["destination"]["code_icao"] }} / - {{ flight["destination"]["code_iata"] }} + {% for i in range(0,len) %} + {% if i%2 == 0 %} + {% else %} - {% endif %} - - - {% if flight["status"] != "Scheduled" %} - {{ flight["status"] }} - {% else %} - {% endif %} - - + + {% endif %} + {{ flight[i]["ident"] }} + {{ flight[i]["scheduled_off"] }} + {% if flight[i]["departure_delay"] %} + {{ flight[i]["departure_delay"] }} + {% else %} + {% endif %} + + {{ flight[i]["operator"] }} + + {% if flight[i]["destination"]["name"] %} + {{ flight[i]["destination"]["name"] }} + {{ flight[i]["destination"]["code_icao"] }} / + {{ flight[i]["destination"]["code_iata"] }} + {% else %} + {% endif %} + + + {% if flight[i]["status"] != "Scheduled" %} + {{ flight[i]["status"] }} + {% else %} + {% endif %} + + {% endfor %}