Split space launches into separate page

Closes: #93
This commit is contained in:
Edward Betts 2024-01-03 09:13:58 +00:00
parent 2b3e4f8d72
commit 9800030201
4 changed files with 66 additions and 46 deletions

View file

@ -16,6 +16,7 @@ import yaml
import agenda.data
import agenda.error_mail
import agenda.thespacedevs
import agenda.travel
app = flask.Flask(__name__)
@ -61,6 +62,17 @@ async def index() -> str:
return flask.render_template("index.html", today=now.date(), **data)
@app.route("/launches")
async def launch_list() -> str:
"""Web page showing List of space launches."""
now = datetime.now()
data_dir = app.config["DATA_DIR"]
rocket_dir = os.path.join(data_dir, "thespacedevs")
rockets = await agenda.thespacedevs.get_launches(rocket_dir, limit=100)
return flask.render_template("launches.html", rockets=rockets, now=now)
@app.route("/gaps")
async def gaps_page() -> str:
"""List of available gaps."""