{% extends "@ChillMain/layout.html.twig" %}

{% set thirdParty = entity %}
{% form_theme form '@ChillThirdParty/ThirdParty/_form_thirdparty_children.html.twig' %}

{% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %}

{% block content %}
    <div class="thirdparty-new my-5">
        <div class="row justify-content-center">
            {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
                {% block crud_content_header %}
                    <h1>
                        {{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }}
                        <span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }} float-end"
                              title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
                            {{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
                        </span>
                    </h1>
                {% endblock %}
                {% block crud_content_form_rows %}
                    <div class="date-by">
                        {% if thirdParty.updatedAt != null %}
                            {{ 'thirdparty.UpdatedAt.short'|trans ~ thirdParty.updatedAt|format_date('short') }}
                        {% else %}
                            {{ 'thirdparty.CreatedAt.short'|trans ~ thirdParty.createdAt|format_date('short') }}
                        {% endif %}
                        {% if thirdParty.updatedBy != null %}
                            {{ 'thirdparty.UpdateBy.short'|trans ~ thirdParty.updatedBy.usernameCanonical }}
                        {% endif %}
                    </div>
                    {% include '@ChillThirdParty/ThirdParty/_form.html.twig' %}
                {% endblock %}
            {% endembed %}
        </div>
    </div>
{% endblock %}

{% block js %}
    {{ encore_entry_script_tags('mod_input_address') }}
{% endblock %}

{% block css %}
    {{ encore_entry_link_tags('mod_input_address') }}
{% endblock %}
