{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}

{% block title %}{{ 'admin.motive.view.title'|trans }}{% endblock title %}

{% block admin_content %}

    <h1>{{ 'admin.motive.view.title'|trans }}</h1>

    <table class="record_properties table table-bordered">
        <tbody>
            <tr>
                <th>{{ 'Id'|trans }}</th>
                <td>{{ entity.id }}</td>
            </tr>
            <tr>
                <th>{{ 'Label'|trans }}</th>
                <td>{{ entity.label|localize_translatable_string }}</td>
            </tr>
            <tr>
                <th>{{ 'Active'|trans }}</th>
                <td style="text-align:center;">
                    {%- if entity.isActive -%}
                        <i class="fa fa-check-square-o"></i> {{ 'Yes'|trans }}
                    {%- else -%}
                        <i class="fa fa-square-o"></i> {{ 'No'|trans }}
                    {%- endif -%}
                </td>
            </tr>
            <tr>
                <th>{{ 'emergency?'|trans }}</th>
                <td>
                    {%- if entity.makeTicketEmergency -%}
                        {{ entity.makeTicketEmergency.value|trans }}
                    {%- else -%}
                        -
                    {%- endif -%}
                </td>
            </tr>
        </tbody>
    </table>

    {% if entity.supplementaryComments is not empty %}
        <h2>{{ 'Supplementary comments'|trans }}</h2>
        <div class="supplementary-comments">
            {% for comment in entity.supplementaryComments %}
                <div class="card mb-3">
                    <div class="card-body">
                        <div class="comment-content">
                            {{ comment.label|raw }}
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    {% else %}
        <h2>{{ 'Supplementary comments'|trans }}</h2>
        <p class="text-muted">{{ 'No supplementary comments'|trans }}</p>
    {% endif %}

    <ul class="record_actions sticky-form-buttons">
        <li class="cancel">
            <a href="{{ path('chill_crud_motive_index') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
        </li>
        <li>
            <a href="{{ path('chill_crud_motive_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
        </li>
    </ul>
{% endblock %}
