{% extends 'common/master.html' %}
{% block body %}
<h1>View Download Attempts</h1>
<a href="{% url 'view_downloads_csv' %}">Download latest 100 as CSV</a>
<a href="{% url 'view_all_downloads_csv' %}">Download all as CSV</a>
<table>
    <tr>
        <th>Email</th>
        <th>Address</th>
        <th>IP</th>
        <th>Geolocation</th>
        <th>Timestamp</th>
        <th>Valid Code</th>
        <th>Email Sent</th>
    </tr>
    {% for req in requests %}
    <tr>
        <td>{{ req.user.email }}</td>
        <td>{{ req.pdf.address.address }}</td>
        <td>{{ req.ip }}</td>
        <td>{{ req.geolocation }}</td>
        <td>{{ req.timestamp }}</td>
        <td>{{ req.code_correct }}</td>
        <td>{{ req.email_sent }}</td>
    </tr>
    {% endfor %}
</table>
{% endblock %}
