{% extends '@Parthenon/athena/base.html.twig' %}

{% block pagetitle %}
    {{ "parthenon.rule_engine.add.title"|trans }}
{% endblock %}

{% block content %}

<div class="card shadow mb-4">
    <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary">{{ "parthenon.rule_engine.add.subtitle"|trans }}</h6>
    </div>
    <div class="card-body">


        {{ form_start(form) }}


        <div class="my-custom-class-for-errors">
            {{ form_errors(form) }}
        </div>
        <div class="form-group row">
            <label for="filter-entity" class="col-sm-2 col-form-label">{{ form_label(form.entity) }}</label>
            <div class="col-sm-10">
                {{ form_widget(form.entity) }}
            </div>
        </div>
        <div class="form-group row">
            <label for="filter-field" class="col-sm-2 col-form-label">{{ form_label(form.field) }}</label>
            <div class="col-sm-10">
                {{ form_widget(form.field) }}
            </div>
        </div>
        <div class="form-group row">
            <label for="filter-comparison" class="col-sm-2 col-form-label">{{ form_label(form.comparison) }}</label>
            <div class="col-sm-10">
                {{ form_widget(form.comparison) }}
            </div>
        </div>
        <div class="form-group row">
            <label for="filter-value" class="col-sm-2 col-form-label">{{ form_label(form.value) }}</label>
            <div class="col-sm-10">
                {{ form_widget(form.value) }}
            </div>
        </div>
        <div class="form-group row">
            <label for="filter-action" class="col-sm-2 col-form-label">{{ form_label(form.action) }}</label>
            <div class="col-sm-10">
                {{ form_widget(form.action) }}
            </div>
        </div>
        <div id="action-options">

        </div>

            {{ form_widget(form) }}
            <button type="submit" class="btn btn-success" id="rule_engine_add_submit">{{ "parthenon.rule_engine.add.submit"|trans }}</button>
        {{ form_end(form) }}

    </div>
</div>
    <script>
        var entityProperties = {{ entityProperties|json_encode|raw }}
        var actionOptions = {{ actionOptions|json_encode|raw }}
    </script>
    <script
            src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
            integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
            crossorigin="anonymous"></script>

    <script src="{{ asset('bundles/parthenon/js/athena/rule-engine.js') }}"></script>
{% endblock %}
