Include route distances on trips page
This commit is contained in:
parent
b5c1e16901
commit
fe4bde32ba
2 changed files with 20 additions and 5 deletions
|
|
@ -218,9 +218,11 @@ def accommodation_list() -> str:
|
|||
@app.route("/trip")
|
||||
def trip_list() -> str:
|
||||
"""Page showing a list of trips."""
|
||||
route_distances = agenda.travel.load_route_distances(app.config["DATA_DIR"])
|
||||
|
||||
trip_list = [
|
||||
trip
|
||||
for trip in agenda.trip.build_trip_list()
|
||||
for trip in agenda.trip.build_trip_list(route_distances=route_distances)
|
||||
if flask.g.user.is_authenticated or not trip.private
|
||||
]
|
||||
|
||||
|
|
@ -309,9 +311,10 @@ def human_readable_delta(future_date: date) -> str | None:
|
|||
@app.route("/trip/<start>")
|
||||
def trip_page(start: str) -> str:
|
||||
"""Individual trip page."""
|
||||
route_distances = agenda.travel.load_route_distances(app.config["DATA_DIR"])
|
||||
trip_list = [
|
||||
trip
|
||||
for trip in agenda.trip.build_trip_list()
|
||||
for trip in agenda.trip.build_trip_list(route_distances=route_distances)
|
||||
if flask.g.user.is_authenticated or not trip.private
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue