Additional refactoring
This commit is contained in:
@@ -1,10 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
{% set active_page = "seasons" %}
|
||||
{% block title %}{{ model.season_code }} - Episodes{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{% block content %}
|
||||
{% if g.is_editor %}
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<a class="btn btn-primary" href="/newepisode" role="button">New Episode</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not model.player_list %}
|
||||
There are no episodes.
|
||||
{% 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"></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ep in model.episodes %}
|
||||
<tr>
|
||||
{% for prop, _ in model.columns %}
|
||||
<td class="col-sm-auto text-center">{{ ep[prop] }}</td>
|
||||
{% endfor %}
|
||||
|
||||
<a class="btn btn-dark" href="/episodes/{{ ep['id'] }}">Show</a>
|
||||
{% if g.is_editor %}
|
||||
<td class="col-sm-auto text-center">
|
||||
<a class="btn btn-dark" href="/editepisode/{{ ep['id'] }}">Edit</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user