{% load ajax_helpers modal_tags %}
<div class="m-2">
    {% if not no_title %}
        <h5>Authorised Device Cookies</h5>
    {% endif %}
    {% if not cookies %}
        <p>No authorised device cookies</p>
    {% else %}
    <table class="table table-sm ">
        <tr>
            <th>Cookie</th>
            <th>Last used</th>
            <th></th>
        </tr>
        {% for c in cookies %}
            <tr>
                <td>{{ c.name }}</td>
                <td>{{ c.last_used|date }}</td>
                <td>{% modal_button_method 'Remove' 'remove_device' id=c.id css_class='btn btn-sm btn-outline-warning' %}</td>
            </tr>
        {% endfor %}
    </table>
    {% endif %}
</div>