<div class="container">
    {% for s in signatures %}
        <div class="row row-hover align-items-center">
            <div class="col-sm-12 col-md-5">
                {% if s.signerKind == 'person' %}
                    {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
                        action: 'show', displayBadge: true,
                        targetEntity: { name: 'person', id: s.signer.id },
                        buttonText: s.signer|chill_entity_render_string,
                        isDead: s.signer.deathDate is not null
                    } %}
                {% else %}
                    {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
                        action: 'show', displayBadge: true,
                        targetEntity: { name: 'user', id: s.signer.id },
                        buttonText: s.signer|chill_entity_render_string,
                    } %}
                {% endif %}
            </div>
            <div class="col-sm-12 col-md-7 text-end">
                {% if s.isSigned %}
                    <span class="text-end">{{ 'workflow.signature.signed_statement'|trans({ 'datetime' : s.stateDate }) }}</span>
                {% elseif s.isCanceled %}
                    <span class="text-end">{{ 'workflow.signature.canceled_statement'|trans({ 'datetime' : s.stateDate }) }}</span>
                {% elseif s.isRejected%}
                    <span class="text-end">{{ 'workflow.signature.rejected_statement'|trans({ 'datetime' : s.stateDate }) }}</span>
                {% else %}
                    {% if (is_granted('CHILL_MAIN_ENTITY_WORKFLOW_SIGNATURE_CANCEL', s) or is_granted('CHILL_MAIN_ENTITY_WORKFLOW_SIGNATURE_SIGN', s)) %}
                        <ul class="record_actions slim {% if is_small|default(false) %}small{% endif %}">
                            {% if is_granted('CHILL_MAIN_ENTITY_WORKFLOW_SIGNATURE_REJECT', s) %}
                                <li>
                                    <a class="btn btn-remove" href="{{ chill_path_add_return_path('chill_main_workflow_signature_reject', { 'id': s.id}) }}">{{ 'workflow.signature_zone.button_reject'|trans }}</a>
                                </li>
                            {% endif %}
                            {% if is_granted('CHILL_MAIN_ENTITY_WORKFLOW_SIGNATURE_CANCEL', s) %}
                                <li>
                                    <a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_main_workflow_signature_cancel', { 'id': s.id}) }}">{{ 'workflow.signature_zone.button_cancel'|trans }}</a>
                                </li>
                            {% endif %}
                            {% if is_granted('CHILL_MAIN_ENTITY_WORKFLOW_SIGNATURE_SIGN', s) %}
                                <li>
                                    <a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_main_workflow_signature_metadata', { 'signature_id': s.id}) }}"><i class="fa fa-pencil-square-o"></i> {{ 'workflow.signature_zone.button_sign'|trans }}</a>
                                </li>
                            {% endif %}
                        </ul>
                    {% endif %}
                {% endif %}
            </div>
        </div>
    {% endfor %}
</div>

