{% load rl %}
{% extends 'admin/base_site.html' %}

{% block title %}Logged requests{% endblock %}

{% block content %}

{% pyexec from django.conf import settings %}

<p>settings.APPNAME: {{ settings.APPNAME }}</p>

<p>Entries are shown for the last {{ nrDaysBack }} days.</p>

<p>Requests whose pickled request data could not be unpickled are shown in red.</p>

{% if not requests %}
<p>No data found &#8212; try picking different options from the menus above.</p>
{% endif %}

<table>
    <thead>
        <tr>
            <th>Timestamp</th>
            <th>URL</th>
            <th>GET</th>
            <th>POST</th>
        </tr>
    </thead>
    <tbody>
        {% for request in requests %}
        <tr {% if request.bad %} style="background-color: #ff0000" {% endif %}>
            <td>{{ request.timestamp }}</td>
            <td>{{ request.url }}</td>
            <td>{{ request.get }}</td>
            <td>{{ request.post }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}{% # content %}
