mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-13 12:13:21 -06:00
add in html pages for season and episode, baseline zero css
This commit is contained in:
@@ -53,7 +53,7 @@ class Season(db.Model):
|
|||||||
@property
|
@property
|
||||||
def episodes(self):
|
def episodes(self):
|
||||||
"""returns a List of Episodes under this Season"""
|
"""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
|
@property
|
||||||
def characters(self, sort):
|
def characters(self, sort):
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ def view():
|
|||||||
|
|
||||||
if season != -1:
|
if season != -1:
|
||||||
if episode != -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:
|
else:
|
||||||
return render_template('season.html', season=Season.query.filter_by(id=season).first_or_404())
|
return render_template('season.html', season=Season.query.filter_by(id=season).first_or_404())
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
@@ -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>
|
||||||
4
app/templates/content.html
Normal file
4
app/templates/content.html
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block body %}
|
||||||
|
{{ super() }}
|
||||||
|
{% endblock body %}
|
||||||
@@ -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 %}
|
||||||
@@ -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 %}
|
||||||
Reference in New Issue
Block a user