parent
4b6f4231b7
commit
44bf744361
2 changed files with 33 additions and 0 deletions
14
web_view.py
14
web_view.py
|
|
@ -253,6 +253,19 @@ def trip_page(start: str) -> str:
|
|||
if "geojson_filename" in route:
|
||||
route["geojson"] = agenda.trip.read_geojson(route.pop("geojson_filename"))
|
||||
|
||||
if trip.end:
|
||||
countries = {c.alpha_2 for c in trip.countries}
|
||||
holidays = [
|
||||
hol
|
||||
for hol in agenda.holidays.get_all(
|
||||
trip.start, trip.end, app.config["DATA_DIR"]
|
||||
)
|
||||
if hol.country.upper() in countries
|
||||
]
|
||||
holidays.sort(key=lambda item: (item.date, item.country))
|
||||
else:
|
||||
holidays = []
|
||||
|
||||
return flask.render_template(
|
||||
"trip_page.html",
|
||||
trip=trip,
|
||||
|
|
@ -263,6 +276,7 @@ def trip_page(start: str) -> str:
|
|||
routes=routes,
|
||||
get_country=agenda.get_country,
|
||||
format_list_with_ampersand=format_list_with_ampersand,
|
||||
holidays=holidays,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue