From b027c11c67be6a21c9a83701c2a448dc7dfbc141 Mon Sep 17 00:00:00 2001 From: luxick Date: Sat, 2 Mar 2019 16:46:33 +0100 Subject: [PATCH] Add episode details page. --- app.py | 17 +++++++++++++++++ templates/episode_details.html | 9 +++++++++ templates/season_overview.html | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 templates/episode_details.html diff --git a/app.py b/app.py index 02e5652..3dfa253 100644 --- a/app.py +++ b/app.py @@ -179,6 +179,23 @@ def season_overview(season_id: int): return render_template("season_overview.html", model=model) +@app.route("/seasons//episodes/") +@authorize +def episode_detail(season_id: int, episode_id: int): + sql, args = db.load_season(season_id) + season = db.query_db(sql, args, one=True, cls=models.Season) + sql, args = db.load_episode(episode_id) + episode = db.query_db(sql, args, one=True, cls=models.Episode) + sql, args = db.load_episode_players(episode_id) + ep_players = db.query_db(sql, args, cls=models.Player) + + model = { + "title": f"{season.code}{episode.code}" + } + + return render_template("episode_details.html", model=model) + + @app.route("/seasons//episodes", methods=["GET"]) @authorize def episode_list(season_id: int): diff --git a/templates/episode_details.html b/templates/episode_details.html new file mode 100644 index 0000000..a3e13b3 --- /dev/null +++ b/templates/episode_details.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% set active_page = "seasons" %} +{% block title %}{{ model.title }} {{ super() }}{% endblock %} + +{% block content %} +
+ +
+{% endblock %} \ No newline at end of file diff --git a/templates/season_overview.html b/templates/season_overview.html index db35403..3947327 100644 --- a/templates/season_overview.html +++ b/templates/season_overview.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% set active_page = "seasons" %} -{% block title %}{{ model.title }}{% endblock %} +{% block title %}{{ model.title }} {{ super() }}{% endblock %} {% block content %}
@@ -57,7 +57,8 @@ {{ item.title }} - + + {% if g.is_editor %}