Link from conference list to trip pages
This commit is contained in:
parent
36168843d6
commit
31e8197c79
3 changed files with 19 additions and 5 deletions
11
web_view.py
11
web_view.py
|
|
@ -104,10 +104,21 @@ def conference_list() -> str:
|
|||
filepath = os.path.join(data_dir, "conferences.yaml")
|
||||
item_list = yaml.safe_load(open(filepath))
|
||||
today = date.today()
|
||||
trip_list = agenda.trip.build_trip_list()
|
||||
conference_trip_lookup = {}
|
||||
for trip in trip_list:
|
||||
for trip_conf in trip.conferences:
|
||||
key = (trip_conf["start"], trip_conf["name"])
|
||||
conference_trip_lookup[key] = trip
|
||||
|
||||
for conf in item_list:
|
||||
conf["start_date"] = as_date(conf["start"])
|
||||
conf["end_date"] = as_date(conf["end"])
|
||||
|
||||
key = (conf["start"], conf["name"])
|
||||
if this_trip := conference_trip_lookup.get(key):
|
||||
conf["trip"] = this_trip
|
||||
|
||||
item_list.sort(key=operator.itemgetter("start_date"))
|
||||
|
||||
current = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue