Add Seasons.

This commit is contained in:
2019-01-12 14:49:39 +01:00
parent c090d65038
commit 30bab3e651
5 changed files with 237 additions and 17 deletions

View File

@@ -3,5 +3,48 @@
{% block title %}Seasons{% endblock %}
{% block content %}
There are no seasons.
{% if g.is_editor %}
<div class="btn-toolbar" role="toolbar">
<a class="btn btn-primary" href="/newseason" role="button">New Season</a>
</div>
{% endif %}
{% if not model.seasons %}
There are no seasons.
{% else %}
<table class="table table-hover table-striped table-bordered">
<thead>
<tr>
{% for prop, caption in model.columns %}
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
{% endfor %}
<th scope="col" class="col-sm-auto text-center"></th>
{% if g.is_editor %}
<th scope="col" class="col-sm-auto text-center">Editor</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for item in model.seasons %}
<tr>
{% for prop, caption in model.columns %}
<td class="col-sm-auto text-center">{{ item[prop] }}</td>
{% endfor %}
<td class="col-sm-auto text-center">
<a class="btn btn-dark" href="/seasons/{{ item.id }}">Show</a>
</td>
{% if g.is_editor %}
<td class="col-sm-auto text-center">
<a class="btn btn-dark" href="/seasons/edit/{{ item.id }}">Edit</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}