{% extends kimai_context.modalRequest ? 'form.html.twig' : 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}

{% block main %}
    {% set formEditTemplate = kimai_context.modalRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
    {% set formOptions = {
        'title': (tag.id is null ? 'create'|trans : 'edit'|trans({}, 'actions')),
        'form': form,
        'back': path('tags')
    } %}
    {% embed formEditTemplate with formOptions %}
        {% form_theme form 'form/horizontal.html.twig' %}
        {% block form_body %}
            {{ form_row(form.name) }}
            {{ form_row(form.color) }}
            {{ form_rest(form) }}
        {% endblock %}
    {% endembed %}
{% endblock %}
