{% extends 'base.html.twig' %}
{% block title %}Battles{% endblock %}
{% block body %}
<a href="/battles/new" class="btn btn-light">New Battle</a>
{% if battles %}
<table id="battles_list" class="table table-striped">
<thead>
<tr>
<th>Battle Title</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for battle in battles %}
<tr>
<td>{{ battle.title }}</td>
<td>
<a href="/battles/{{ battle.id }}" class="btn btn-dark">Show</a>
<a href="/battles/edit/{{ battle.id }}" class="btn btn-light">Edit</a>
<a href="/tools/controller?battle={{ battle.id }}" target="_blank" class="btn btn-light">Live Controll</a>
<a href="/tools?battle={{ battle.id }}" target="_blank" class="btn btn-light">Tools</a>
<a href="#" class="btn btn-danger delete-battles" data-id="{{ battle.id }}">Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No battles to display</p>
{% endif %}
{% endblock %}