diff --git a/templates/index.html b/templates/index.html
index e6d5be7..1f8ab24 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -92,8 +92,11 @@
Agenda
- ← personal tools |
- travel
+ ← personal tools
+ |
+ travel
+ |
+ conference
diff --git a/web_view.py b/web_view.py
index e9848c6..112a824 100755
--- a/web_view.py
+++ b/web_view.py
@@ -3,13 +3,15 @@
"""Web page to show upcoming events."""
import inspect
+import os.path
import sys
import traceback
-from datetime import datetime
+from datetime import date, datetime
import flask
import werkzeug
import werkzeug.debug.tbtools
+import yaml
import agenda.data
import agenda.travel
@@ -55,18 +57,32 @@ async def index() -> str:
@app.route("/travel")
-def travel_page() -> str:
+def travel_list() -> str:
"""Page showing a list of upcoming travel."""
- now = datetime.now()
-
config = agenda.data.get_config()
data_dir = config["data"]["personal-data"]
flights = agenda.travel.parse_yaml("flights", data_dir)
trains = agenda.travel.parse_yaml("trains", data_dir)
- return flask.render_template(
- "travel.html", today=now.date(), flights=flights, trains=trains
- )
+ return flask.render_template("travel.html", flights=flights, trains=trains)
+
+
+def as_date(d: date | datetime) -> date:
+ """Date of event."""
+ return d.date() if isinstance(d, datetime) else d
+
+
+@app.route("/conference")
+def conference_list() -> str:
+ """Page showing a list of conferences."""
+ config = agenda.data.get_config()
+ data_dir = config["data"]["personal-data"]
+ filepath = os.path.join(data_dir, "conferences.yaml")
+ item_list = yaml.safe_load(open(filepath))["conferences"]
+
+ item_list.sort(key=lambda conf: as_date(conf["start"]))
+
+ return flask.render_template("conference_list.html", item_list=item_list)
if __name__ == "__main__":