diff --git a/.gitignore b/.gitignore index a2e4b43..f51df2f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ app.db keys.json process.py app.db-journal +test.html # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/app/routes.py b/app/routes.py index efd0199..9f5ae46 100644 --- a/app/routes.py +++ b/app/routes.py @@ -16,4 +16,4 @@ def view(): return render_template('episode.html', episode=Episode.query.filter_by(season_id=season, number=episode).first_or_404()) else: return render_template('season.html', season=Season.query.filter_by(id=season).first_or_404()) - return redirect(url_for('index')) \ No newline at end of file + return render_template('view.html', seasons=Season.query.all()) \ No newline at end of file diff --git a/app/templates/season.html b/app/templates/season.html index 330244e..aec2de8 100644 --- a/app/templates/season.html +++ b/app/templates/season.html @@ -2,8 +2,10 @@ {% block body %} {{ super() }} Season {{ season.id }} +
{% for episode in season.episodes %} -Episode {{ episode.number }} +Episode {{ episode.number }} +
{% endfor %} {% endblock body %} \ No newline at end of file diff --git a/app/templates/view.html b/app/templates/view.html new file mode 100644 index 0000000..2af8502 --- /dev/null +++ b/app/templates/view.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% block body %} +{{ super() }} +{% for season in seasons %} +Season {{ season.id }} +
+{% endfor %} + +{% endblock body %} \ No newline at end of file