Add option for unpublished trips
This commit is contained in:
parent
e3cae68d2f
commit
d690442f0f
3 changed files with 30 additions and 4 deletions
21
web_view.py
21
web_view.py
|
|
@ -209,7 +209,11 @@ def accommodation_list() -> str:
|
|||
@app.route("/trip")
|
||||
def trip_list() -> str:
|
||||
"""Page showing a list of trips."""
|
||||
trip_list = agenda.trip.build_trip_list()
|
||||
trip_list = [
|
||||
trip
|
||||
for trip in agenda.trip.build_trip_list()
|
||||
if flask.g.user.is_authenticated or not trip.private
|
||||
]
|
||||
|
||||
today = date.today()
|
||||
current = [
|
||||
|
|
@ -242,7 +246,11 @@ def trip_list() -> str:
|
|||
@app.route("/trip/text")
|
||||
def trip_list_text() -> str:
|
||||
"""Page showing a list of trips."""
|
||||
trip_list = agenda.trip.build_trip_list()
|
||||
trip_list = [
|
||||
trip
|
||||
for trip in agenda.trip.build_trip_list()
|
||||
if flask.g.user.is_authenticated or not trip.private
|
||||
]
|
||||
|
||||
today = date.today()
|
||||
future = [item for item in trip_list if item.start > today]
|
||||
|
|
@ -292,7 +300,14 @@ def human_readable_delta(future_date: date) -> str | None:
|
|||
@app.route("/trip/<start>")
|
||||
def trip_page(start: str) -> str:
|
||||
"""Individual trip page."""
|
||||
trip_iter = iter(agenda.trip.build_trip_list())
|
||||
|
||||
trip_list = [
|
||||
trip
|
||||
for trip in agenda.trip.build_trip_list()
|
||||
if flask.g.user.is_authenticated or not trip.private
|
||||
]
|
||||
|
||||
trip_iter = iter(trip_list)
|
||||
today = date.today()
|
||||
data_dir = flask.current_app.config["PERSONAL_DATA"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue