From ade69893004304c02feb5a2ca0f140e09ceb5d5f Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 2 Jun 2024 19:01:18 +0100 Subject: [PATCH 1/4] Show links to flight data web sites --- templates/trip/list.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/trip/list.html b/templates/trip/list.html index eb0900b..f7a0580 100644 --- a/templates/trip/list.html +++ b/templates/trip/list.html @@ -124,6 +124,8 @@ – {{ e.end_loc }} {{ e.end_country.flag }} {% if e.element_type == "flight" %} + {% set full_flight_number = e.detail.airline + e.detail.flight_number %} + {% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %} airline: {{ e.detail.airline_name }} flight number: {{ e.detail.airline }}{{ e.detail.flight_number }} {% if e.detail.duration %} @@ -134,6 +136,11 @@ {% if e.detail.distance %} distance: {{ format_distance(e.detail.distance) }} {% endif %} + {% if e.element_type == "flight" %} + flightradar24 + | FlightAware + | radarbox + {% endif %} {% endif %} {% endfor %} From 5de5e2288318a270fbb84788e56ca9394a7760bc Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 2 Jun 2024 19:04:37 +0100 Subject: [PATCH 2/4] Fix docstrings --- agenda/accommodation.py | 4 ++-- agenda/carnival.py | 2 +- agenda/domains.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agenda/accommodation.py b/agenda/accommodation.py index f5b7e83..59eb111 100644 --- a/agenda/accommodation.py +++ b/agenda/accommodation.py @@ -1,4 +1,4 @@ -"""Accomodation""" +"""Accommodation.""" import yaml @@ -6,7 +6,7 @@ from .types import Event def get_events(filepath: str) -> list[Event]: - """Get accomodation from YAML.""" + """Get accommodation from YAML.""" with open(filepath) as f: return [ Event( diff --git a/agenda/carnival.py b/agenda/carnival.py index 41a995b..c6f429d 100644 --- a/agenda/carnival.py +++ b/agenda/carnival.py @@ -1,4 +1,4 @@ -"""Calcuate the date for carnival.""" +"""Calculate the date for carnival.""" from datetime import date, timedelta diff --git a/agenda/domains.py b/agenda/domains.py index 99c614e..89aae32 100644 --- a/agenda/domains.py +++ b/agenda/domains.py @@ -1,4 +1,4 @@ -"""Accomodation.""" +"""Domain renewal dates.""" import csv import os From 733608bc2f26b5c4f22cea13c5e1ef467b57fef6 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 2 Jun 2024 19:05:04 +0100 Subject: [PATCH 3/4] Fix spelling --- agenda/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agenda/data.py b/agenda/data.py index a18d74d..d640557 100644 --- a/agenda/data.py +++ b/agenda/data.py @@ -42,7 +42,7 @@ here = dateutil.tz.tzlocal() # deadline to file tax return # credit card expiry dates # morzine ski lifts -# chalet availablity calendar +# chalet availability calendar # starlink visible From 4c651198f34777f930b9f363998cb31a5717f20a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 3 Jun 2024 19:30:14 +0100 Subject: [PATCH 4/4] Add birthday list page --- templates/birthday_list.html | 17 +++++++++++++++++ templates/navbar.html | 4 +++- web_view.py | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 templates/birthday_list.html diff --git a/templates/birthday_list.html b/templates/birthday_list.html new file mode 100644 index 0000000..7346bae --- /dev/null +++ b/templates/birthday_list.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% from "macros.html" import display_date %} +{% block title %}Birthdays - Edward Betts{% endblock %} + +{% block content %} +
+

Birthdays

+ + {% for event in items %} + + + + + {% endfor %} +
{{event.as_date.strftime("%a, %d, %b")}}{{ event.title }}
+
+{% endblock %} diff --git a/templates/navbar.html b/templates/navbar.html index 04fa3f9..42626fd 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -11,7 +11,9 @@ {"endpoint": "weekends", "label": "Weekend" }, {"endpoint": "launch_list", "label": "Space launch" }, {"endpoint": "holiday_list", "label": "Holiday" }, -] %} + ] + ([{"endpoint": "birthday_list", "label": "Birthdays" }] + if g.user.is_authenticated else []) + %}