mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-06 05:16:47 -06:00
add basic "Seasons" view
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ app.db
|
||||
keys.json
|
||||
process.py
|
||||
app.db-journal
|
||||
test.html
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
||||
@@ -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'))
|
||||
return render_template('view.html', seasons=Season.query.all())
|
||||
@@ -2,8 +2,10 @@
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
Season {{ season.id }}
|
||||
<br>
|
||||
{% for episode in season.episodes %}
|
||||
<a href="/view?season={{ season.id }}&episode={{ episode.number }}" >Episode {{ episode.number }}</a>
|
||||
<a href="/view?season={{ season.id }}&episode={{ episode.number }}" >Episode {{ episode.number }}</a>
|
||||
<br>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock body %}
|
||||
9
app/templates/view.html
Normal file
9
app/templates/view.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
{% for season in seasons %}
|
||||
<a href="/view?season={{ season.id }}" >Season {{ season.id }}</a>
|
||||
<br>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock body %}
|
||||
Reference in New Issue
Block a user