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

{% block adminContent %}
    <div class="d-flex">
        <div>
            <h1>{{ 'admin.priorities.title'|trans }}</h1>
            <p>{{ 'admin.priorities.subtitle'|trans }}</p>
        </div>
    </div>
    
    {% include 'flashMessages.html.twig' %}

    {{ form_start(form) }}    
        
        {{ form_row(form.ativo) }}
    
        {{ form_row(form.nome) }}

        {{ form_row(form.descricao) }}

        {{ form_row(form.peso) }}

        {{ form_row(form.cor) }}

        <div class="d-flex">
            <button type="submit" class="btn btn-primary">
                <i class="fa fa-check"></i> 
                {{ 'button.save'|trans }}
            </button>
            <a href="{{ path('admin_prioridades_index') }}" class="btn btn-link text-decoration-none ms-2">
                <i class="fa fa-chevron-left"></i>
                {{ 'button.back'|trans }}
            </a>
            {% if entity.id %}
                <button type="submit" class="btn btn-danger ms-auto" form="delete-form">
                    <i class="fa fa-trash"></i> 
                    {{ 'button.remove'|trans }}
                </button>
            {% endif %}
        </div>

    {{ form_end(form) }}

    {% if entity.id %}
        <form
            id="delete-form"
            method="post"
            action="{{ path('admin_prioridades_delete', { id: entity.id }) }}"
            onsubmit="return confirm('Você realmente deseja remover?')">
        </form>
    {% endif %}
{% endblock %}
