diff --git a/templates/macros.html b/templates/macros.html index 5bdadc5..ff49986 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -96,6 +96,10 @@ {% endmacro %} +{% macro flightradar24_url(flight) -%} +https://www.flightradar24.com/data/flights/{{ flight.airline_detail.iata | lower + flight.flight_number }} +{%- endmacro %} + {% macro flight_booking_row(booking, show_flags=True) %}
{% if g.user.is_authenticated %} @@ -134,8 +138,8 @@
{{ item.duration }}
{{ full_flight_number }}
- flightradar24 - | FlightAware + flightradar24 + | FlightAware | radarbox
@@ -169,8 +173,8 @@ {% endif %}
- flightradar24 - | FlightAware + flightradar24 + | FlightAware | radarbox
@@ -402,21 +406,22 @@ – {{ e.end_loc }} {{ flag(trip, e.end_country.flag) }} {% if e.element_type == "flight" %} - {% set full_flight_number = e.detail.airline_code + e.detail.flight_number %} + {% set flight = e.detail %} + {% set full_flight_number = flight.airline_code + flight.flight_number %} {% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %} - airline: {{ e.detail.airline_name }} + airline: {{ flight.airline_name }} flight number: {{ full_flight_number }} - {% if e.detail.duration %} - duration: {{ e.detail.duration }} + {% if flight.duration %} + duration: {{ flight.duration }} {% endif %} - {#
{{ e.detail | pprint }}
#} - CO₂: {{ "{:,.1f}".format(e.detail.co2_kg) }} kg + {#
{{ flight | pprint }}
#} + CO₂: {{ "{:,.1f}".format(flight.co2_kg) }} kg {% endif %} {% if e.detail.distance %} distance: {{ format_distance(e.detail.distance) }} {% endif %} {% if e.element_type == "flight" %} - flightradar24 + flightradar24 | FlightAware | radarbox {% endif %}