{% extends 'layouts/default.html' %}
{% block title %}Flowspec Users{% endblock %}
{% block content %}
    <h2>Commands log / latest on top</h2>
    {% if logs %}
        <h5>
        {% if logs.has_prev %}<a href="{{ url_for('admin.log', page=logs.prev_num) }}">&lt;&lt; Newer logs</a>{% else %}&lt;&lt; Newer logs{% endif %} | 
        {% if logs.has_next %}<a href="{{ url_for('admin.log', page=logs.next_num) }}">Older logs &gt;&gt;</a>{% else %}Older logs &gt;&gt;{% endif %}
        </h5>
        <table class="table table-hover">
        <tr>
        <th>time</th>
        <th>task</th>
        <th>rule_type</th>
        <th>rule_id</th>
        <th>author</th>
        </tr>
        {% for log in logs.items %}
            <tr>
            <td>{{ log.time|strftime }}</td>
            <td>{{ log.task }}</td>
            <td>{{ log.rule_type }}</td>
            <td>{{ log.rule_id }}</td>
            <td>{{ log.author }}</td>
            </tr>
        {% endfor %}
        </table>
        <h5>
        {% if logs.has_prev %}<a href="{{ url_for('admin.log', page=logs.prev_num) }}">&lt;&lt; Newer logs</a>{% else %}&lt;&lt; Newer logs{% endif %} | 
        {% if logs.has_next %}<a href="{{ url_for('admin.log', page=logs.next_num) }}">Older logs &gt;&gt;</a>{% else %}Older logs &gt;&gt;{% endif %}
        </h5>
    {% else %}
        <h3>No logs for last two days</h3>
    {% endif %}
{% endblock %}