{% extends "base.html" %}

{% block head %}
    {{ super() }}
    <script>
        const CSRF_TOKEN = "{{ csrf_token() }}";
    </script>
    <script src="{{ url_for('static', filename='js/min/common.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/min/modals.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/actions.js') }}"></script>
{% endblock %}

{% block content %}
<h3 class="mb-3">Actions</h3>

{%- if data -%}
    <div class="row row-cols-1 row-cols-lg-2">
    {%- for action in data -%}
        <div class="col">
            <a href="javascript:" class="btn btn-sm btn-outline-primary my-1 w-100" onclick="actionFormModal({{ action.id }})">{{ action.name }}</a>
        </div>
    {%- endfor -%}
    </div>
{%- endif -%}
    <div class="mt-3">
        <a href="javascript:" class="btn btn-sm btn-outline-primary" onclick="actionFormModal()">+</a>
    </div>
{% endblock %}
