{% extends "base.html.twig" %}

{% block title %}{% trans %}log.list.title{% endtrans %}{% endblock %}

{% block content %}
    <div class="accordion mb-3" id="listAccordion">
        <div class="accordion-item">
            <div class="accordion-header">
                <button class="accordion-button collapsed py-2" data-bs-toggle="collapse" data-bs-target="#searchInfo" disabled>
                    <i class="fa-solid fa-binoculars fa-fw"></i>
                    {% trans %}log.list.title{% endtrans %}
                </button>
            </div>
            <div id="searchInfo" class="accordion-collapse collapse" data-bs-parent="#listAccordion">
                <div class="accordion-body">

                </div>
            </div>


        </div>

        <div class="accordion-item">
            <div class="accordion-header">
                <button class="accordion-button collapsed py-2" type="button" data-bs-toggle="collapse" data-bs-target="#filterFormCollapse" aria-expanded="false" aria-controls="filterFormCollapse"><i class="fa-solid fa-filter fa-fw"></i> {% trans %}filter.title{% endtrans %}</button>
            </div>
            <div id="filterFormCollapse" class="accordion-collapse collapse" data-bs-parent="#listAccordion">
                <div class="accordion-body">
                    {{ form_start(filterForm, {"attr": {"data-controller": "helpers--form-cleanup", "data-action": "helpers--form-cleanup#submit"}}) }}

                    {{ form_row(filterForm.dbId) }}
                    {{ form_row(filterForm.timestamp) }}
                    {{ form_row(filterForm.eventType) }}
                    {{ form_row(filterForm.user) }}
                    {{ form_row(filterForm.level) }}
                    {{ form_row(filterForm.targetType) }}
                    {{ form_row(filterForm.targetId) }}

                    {{ form_row(filterForm.submit) }}
                    {{ form_row(filterForm.discard) }}

                    <div class="row mb-3">
                        <div class="col-sm-9 offset-sm-3">
                            <button type="button" class="btn btn-danger" {{ stimulus_action('helpers/form_cleanup', 'clearAll') }}>{% trans %}filter.clear_filters{% endtrans %}</button>
                        </div>
                    </div>

                    {{ form_end(filterForm) }}
                </div>
            </div>
        </div>
    </div>

    {% import "components/history_log_macros.html.twig" as log %}
    {{ log.system_log_component(datatable) }}
{% endblock %}