{% extends "admin/change_list.html" %}

{% block object-tools %}
    <div>
        <form action="../rule/test_rules/" method="POST">
            {% csrf_token %}
            {% for field in test_rules_form.hidden_fields %}
                {{ field }}
            {% endfor %}
            <div style="display: flex; gap: 8px; flex-direction: column; width: fit-content;">
                {% for field in test_rules_form.visible_fields %}
                    <div>
                        {% if field.label %}{{ field.label_tag }}{% endif %}
                        {{ field.errors }}
                        {{ field }}
                        {% if field.help_text %}<div class="helptext"{% if field.auto_id %} id="{{ field.auto_id }}_helptext"{% endif %}>{{ field.help_text|safe }}</div>{% endif %}

                    </div>
                    <hr/>
                {% endfor %}
                <div style="display: flex; gap: 8px">
                    <button type="submit">Test rules</button>
                    <button type="submit" formaction="../rule/clear_caches/">Clear caches</button>
                    <a href="../rule/simulate_rules/">simulate rules</a>

                </div>
            </div>

        </form>
    </div>
    <br />
    {{ block.super }}
{% endblock %}
