diff --git a/agenda/__init__.py b/agenda/__init__.py index 094421c..4d9a4b4 100644 --- a/agenda/__init__.py +++ b/agenda/__init__.py @@ -343,8 +343,14 @@ def get_accommodation(from_date: date, filepath: str) -> list[Event]: date=from_date, name="accommodation", title=f"check-in {title} ({night_str})", + url=item.get("url"), + ) + checkout = Event( + date=to_date, + name="accommodation", + title="check-out " + title, + url=item.get("url"), ) - checkout = Event(date=to_date, name="accommodation", title="check-out " + title) events += [checkin, checkout] return events @@ -356,6 +362,7 @@ def get_travel(from_date: date, method: str, filepath: str) -> list[Event]: date=item["depart"].date(), name="transport", title=f'{method} from {item["from"]} to {item["to"]}', + url=item.get("url"), ) for item in yaml.safe_load(open(filepath)) if item["depart"].date() >= from_date diff --git a/agenda/types.py b/agenda/types.py index 6877b49..026f2ff 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -11,3 +11,4 @@ class Event: name: str date: date title: str | None = None + url: str | None = None diff --git a/templates/index.html b/templates/index.html index a5e8a57..5bdf5e3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -55,8 +55,10 @@ {{event.date.strftime("%a, %d, %b %Y")}}