Files
estus-shots-py/templates/enemies.html
2019-01-11 19:12:03 +01:00

53 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% set active_page = "enemies" %}
{% block title %}Enemies{% endblock %}
{% block content %}
{% if g.is_editor %}
<div class="btn-toolbar" role="toolbar">
<a class="btn btn-primary" href="/newenemy" role="button">New Enemy</a>
</div>
{% endif %}
{% if not model.enemies %}
There are no enemies.
{% 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 %}
{% if g.is_editor %}
{% for id, caption in model.controls %}
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
{% endfor %}
{% endif %}
</tr>
</thead>
<tbody>
{% for item in model.enemies %}
<tr>
{% for prop, caption in model.columns %}
<td class="col-sm-auto text-center">{{ item[prop] }}</td>
{% endfor %}
{% if g.is_editor %}
{% for name, caption in model.controls %}
<td class="col-sm-auto text-center">
<a class="btn btn-dark"
href="{% if name == 'edit'%}
/enemies/{{ item.id }}
{% endif %}">
{{ caption }}
</a>
</td>
{% endfor %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}