add in html pages for season and episode, baseline zero css

This commit is contained in:
Xevion
2020-01-20 18:47:45 -06:00
parent 0dca7f2a02
commit a15a2b3344
6 changed files with 38 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ class Season(db.Model):
@property
def episodes(self):
"""returns a List of Episodes under this Season"""
return Episode.query.filter_by(season_id=self.id).all().sort(key=lambda ep : ep.number)
return Episode.query.filter_by(season_id=self.id).all()
@property
def characters(self, sort):

View File

@@ -13,7 +13,7 @@ def view():
if season != -1:
if episode != -1:
return render_template('episode.html', episode=Episode.query.filter_by(season_id=season, episode=episode).first_or_404())
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'))

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>The Office Quotes{% if title %} - {{ title }}{% endif %}</title>
{% block head %}
{% endblock head %}
</head>
<body>
{% block body %}
{% endblock body %}
</body>

View File

@@ -0,0 +1,4 @@
{% extends 'base.html' %}
{% block body %}
{{ super() }}
{% endblock body %}

View File

@@ -0,0 +1,10 @@
{% extends 'content.html' %}
{% block body %}
{% for section in episode.sections %}
{% for quote in section.quotes %}
<b>{{ quote.speaker }}:</b> {{ quote.text }}
<br>
{% endfor %}
<br>
{% endfor %}
{% endblock body %}

View File

@@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block body %}
{{ super() }}
Season {{ season.id }}
{% for episode in season.episodes %}
<a href="/view?season={{ season.id }}&episode={{ episode.number }}" >Episode {{ episode.number }}</a>
{% endfor %}
{% endblock body %}