tournament/templates/index.html.twig
2024-03-11 18:16:21 +02:00

54 lines
2.4 KiB
Twig

{% extends "base.html.twig" %}
{% block body %}
<div class="container">
<div class="text-center mt-5">
<form action="/tournament" method="post" style="display: none">
<fieldset>
<legend>Create tournament</legend>
<div class="mb-3">
<label for="title" class="form-label">Tournament title</label>
<input type="text" id="title" name="title" class="form-control"
placeholder="Enter your tournament title">
</div>
<button type="submit" class="btn btn-primary">Create tournament</button>
</fieldset>
</form>
<div class="text-center mt-5"><a href="/generate" class="btn btn-primary">Generate new prefilled
tournament</a></div>
</div>
<div class="text-center mt-5">
{% if tournamentCount > 0 %}
<h3 class="mb-5">There are {{ tournamentCount }} created tournaments.</h3>
{% for tournament in tournamentList %}
<div>
<a href="{{ path('tournament_get', { tournamentId: tournament.getId() }) }}">{{ tournament.getTitle() }}</a>
</div>
{% endfor %}
{% if tournamentCount/tournamentPerPage > page %}
<nav aria-label="Page navigation example" class=" mt-5">
<ul class="pagination justify-content-center">
{% if page > 0 %}
<li class="page-item">
<a class="page-link" href="{{ path('tournament_list_get', { page: page - 1 }) }}">Previous</a>
</li>
{% endif %}
{% if page + 1 < tournamentCount/tournamentPerPage and tournamentList.count() >= tournamentPerPage %}
<li class="page-item">
<a class="page-link" href="{{ path('tournament_list_get', { page: page + 1 }) }}">Next</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% else %}
<div>No tournaments have been created yet.</div>
{% endif %}
</div>
</div>
{% endblock %}