{% extends "afat/base.html" %}

{% load i18n %}

{% block page_title %}{% translate "Fleet Activity Tracking Logs" %}{% endblock %}

{% block afat_header %}
    <br>
    {% include "afat/partials/menu.html" %}

    <h2>{% translate "Logs" %}</h2>

    <p class="text-muted">
        {% blocktranslate %}
            Logs are only kept for {{ log_duration }} days. Logs older than that are removed automatically.
        {% endblocktranslate %}
    </p>
{% endblock %}

{% block afat_body %}
    <div class="panel panel-default">
        <div class="panel-body">
            <table class="table table-striped table-hover" id="afat-logs" style="width: 100%;">
                <thead>
                    <tr>
                        <th>{% translate "Time" %}</th>
                        <th>{% translate "Event" %}</th>
                        <th>{% translate "User" %}</th>
                        <th>{% translate "FAT link" %}</th>
                        <th>{% translate "Description" %}</th>
                    </tr>
                </thead>

                <tbody></tbody>
            </table>
        </div>
    </div>
{% endblock %}

{% block extra_css %}
    {% include "bundles/datatables-css.html" %}
    {% include "afat/bundles/afat-css.html" %}
{% endblock %}

{% block extra_javascript %}
    {% include "bundles/datatables-js.html" %}
    {% include "bundles/moment-js.html" with locale=True %}
    {% include "afat/bundles/afat-js.html" %}

    <script>
        let afatSettings = {
            url: {
                logs: '{% url "afat:logs_ajax_get_logs" %}'
            },
        }
    </script>

    {% include "afat/bundles/afat-logs-js.html" %}
    {% include "bundles/filterdropdown-js.html" %}
{% endblock %}
