Rewrite data layer using SqlAlchemy Part 1
This commit is contained in:
52
estusshots/templates/enemies.html
Normal file
52
estusshots/templates/enemies.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{% extends "base.html" %}
|
||||
{% set active_page = "enemies" %}
|
||||
{% block title %}Enemies {{ super() }}{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
{% if g.is_editor %}
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<a class="btn btn-primary" href="{{ url_for('enemy_new') }}" role="button">
|
||||
<span class="fas fa-plus"></span> Enemy
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not model.enemies %}
|
||||
There are no enemies.
|
||||
{% else %}
|
||||
<table class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="col-sm-auto text-center">Name</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Season</th>
|
||||
<th scope="col" class="col-sm-auto text-center">Boss Enemy</th>
|
||||
|
||||
{% if g.is_editor %}
|
||||
<th scope="col" class="col-sm-auto text-center">Editor</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for enemy in model.enemies %}
|
||||
<tr>
|
||||
<td class="col-sm-auto text-center">{{ enemy.name }}</td>
|
||||
<td class="col-sm-auto text-center">{{ enemy.season.game }}</td>
|
||||
<td class="col-sm-auto text-center">
|
||||
{% if enemy.boss %}
|
||||
<span class="fas fa-check"></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
{% if g.is_editor %}
|
||||
<td class="col-sm-auto text-center">
|
||||
<a class="btn btn-default" href="{{ url_for('enemy_edit', enemy_id = enemy.id) }}">
|
||||
<span class="fas fa-pencil-alt"></span>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user