Rewrite data layer using SqlAlchemy Part 1
This commit is contained in:
133
estusshots/templates/episode_details.html
Normal file
133
estusshots/templates/episode_details.html
Normal file
@@ -0,0 +1,133 @@
|
||||
{% extends "base.html" %}
|
||||
{% set active_page = "seasons" %}
|
||||
{% block title %}{{ model.title }} {{ super() }}{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
{% if g.is_editor %}
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<a class="btn btn-primary" role="button"
|
||||
href="{{ url_for('episode_edit', season_id = model.season.id, episode_id = model.episode.id) }}">
|
||||
<span class="fas fa-pencil-alt"></span> Edit Episode
|
||||
</a>
|
||||
<a class="btn btn-primary" role="button"
|
||||
href="{{ url_for("event_new", ep_id = model.episode.id, s_id = model.season.id) }}" >
|
||||
<span class="fas fa-plus"></span> Event
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
<!--region Info Card-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
{{ model.episode.code }}: {{ model.episode.title }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">Date:</span>
|
||||
{{ model.episode.date }}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">Start:</span>
|
||||
{{ model.episode.start|format_time }}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">End:</span>
|
||||
{{ model.episode.end|format_time }}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">Play Time:</span>
|
||||
{{ model.episode.playtime }}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">Enemies Defeated:</span>
|
||||
{{ model.events.victory_count }}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="font-weight-bold">Deaths:</span>
|
||||
{{ model.events.defeat_count }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--endregion-->
|
||||
|
||||
<hr>
|
||||
|
||||
<!--region Player Card-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
Players in this episode
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="col-sm-auto text-center">Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for player in model.players %}
|
||||
<tr>
|
||||
<td class="col-sm-auto text-center">{{ player.name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--endregion-->
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
{% if model.events %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
Event List
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="col-sm-auto text-center">Time</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Type</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Player</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Enemy</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in model.events.entries %}
|
||||
<tr>
|
||||
<td class="col-sm-auto text-center">{{ entry.time }}</td>
|
||||
<td class="col-sm-auto text-center">{{ entry.type.name }}</td>
|
||||
<td class="col-sm-auto text-center">{{ entry.type.player_name }}</td>
|
||||
<td class="col-sm-auto text-center">{{ entry.type.enemy_name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
Event List
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-info">Nothing did happen yet</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user