{% extends '@kohinos/common/layout.html.twig' %}

{% block content %}
<div class='container listdemandeachatmonnaieform mt-5 mb-5' style='max-width:800px;'>
	{% include '@kohinos/block/breadcrumb.html.twig' with {'label' : 'Demande(s) d\'achat de monnaie'} %}
    <h1 class='pagetitle'>{{ 'Demande(s) d\'achat de monnaie'|trans }} :</h1>
    <div class="row">
    {% if datas|length > 0 %}
        <div class="table-responsive">
            <table class="table">
                <thead>
                  <tr>
                    <th scope="col">Date</th>
                    <th scope="col">Moyen</th>
                    <th scope="col">Montant</th>
                    <th scope="col">Référence</th>
                    <th scope="col">Validée ?</th>
                  </tr>
                </thead>
                <tbody>
                    {% for data in datas %}
                        <tr>
                            <td><span data-toggle="tooltip" data-placement="bottom" title="{{ data.createdAt|date('d/m/Y H:i') }}">{{ data.createdAt|date('d/m/Y') }}</span></td>
                            <td>{{ data.moyen|capitalize }}</td>
                            <td>{{ data.montant }}</td>
                            <td>{{ data.reference }}</td>
                            <td class='{{ data.reconverti ? 'text-success' : 'text-error' }}'>{{ data.reconverti ? 'Oui le '~data.updatedAt|date('d/m/Y à H:i') : 'Non' }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    {% else %}
        <div class='my-2 mx-2'>
            {{ 'Aucunes demandes d\'achat de monnaie pour le moment ! '|trans }}
        </div>
    {% endif %}
    </div>
</div>
{% endblock %}
