{% extends 'base.html.twig' %}
{% block title %}Urls{% endblock %}
{% block body %}
<h1>Urls</h1>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a class="btn btn-success" href="{{ path('app_admin_url_new') }}">Ajouter</a>
</div>
<form method="post" action="{{ path('app_admin_urls_actions') }}">
<input type="hidden" name="_token" value="{{ csrf_token('urls') }}">
<input class="btn btn-warning" type="submit" name="supprimerUrls" value="Supprimer les urls" />
<input class="btn btn-info" type="submit" name="noError" value="Retirer l'erreur" />
<table class="table">
<thead>
<tr>
<th>Selection</th>
<th>Id</th>
<th>Url</th>
<th>Prix</th>
<th>DateTimeMaj</th>
<th>Erreur</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for url in urls %}
<tr>
<td>
<input type="checkbox" name="urls[]" value="{{ url.id }}" style="width:30px; height:30px;"/>
</td>
<td>{{ url.id }}</td>
<td><a href="{{ url.adresse }}" target="_blank">{{ url.adresse }}</a>
<br/>
<small>{{ url.commentaire }}</small>
</td>
<td>{{ url.prix }}</td>
<td>{{ url.dateTimeMaj ? url.dateTimeMaj|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ url.erreur }}</td>
<td>
<a class="link-dark" href="{{ path('app_admin_url_show', {'id': url.id}) }}">Voir</a>
<a class="link-primary" href="{{ path('app_admin_url_edit', {'id': url.id}) }}">Editer</a>
<a class="link-danger" href="{{ path('crawl-force-url', {'id': url.id}) }}">Forcer</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</form>
{% endblock %}