{% extends admin.getTemplate('base_list_field') %}
{% block field %}
    {%- spaceless %}
    {% set cotisEnd = isCotisationValidForAdherent(object.user.adherent) %}
    {% if false != cotisEnd %}
        {% set text = cotisEnd|date('d/m/Y') %}
        {% set class = 'label-success' %}
    {% else %}
        {% set text = 'label_type_no'|trans({}, 'SonataAdminBundle') %}
        {% set class = 'label-danger' %}
    {% endif %}
    <span class="label {{ class }}">{{ text }}</span>
{% endspaceless -%}
{% endblock %}
