{% import '@ChillEvent/EventReason/macro.html.twig' as m %}

{% if "now"|date('U') > event.date|date('U') %}
    {% set boolDate = 'past' %}
{% else %}
    {% set boolDate = 'futur' %}
{% endif %}

<div>
    <h3>{{ event.date|format_date('long') }}
        <span class="event"> /
            {% if boolDate|trans == 'futur' %}
                <span class="chill-orange">Prochain</span> événement
            {% else %}
                {{ 'Event'|trans }} <span class="chill-light-gray">passé</span>
            {% endif %}
        </span>
    </h3>
    <div class="statement">
        <ul class="statement">
            <li>{{ event.name }}</li>
            <li>{{ 'Type: ' ~ event.type.name|localize_translatable_string }}</li>
        </ul>


        {% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), event) %}
            <dl class="chill_view_data">
                <dt class="inline">{{ 'Remark'|trans }}</dt>
                <dd>{% if event.remark is empty %}{{ 'No remarks'|trans }}{% else %}<blockquote class="chill-user-quote">{{ event.remark|nl2br }}</blockquote>{% endif %}</dd>

                <dt class="inline">{{ 'Reasons'|trans }}</dt>
                {%- if event.reasons is empty -%}
                    <dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
                {%- else -%}
                    <dd>{% for r in event.reasons %}{{ m.reason(r) }} {% endfor %}</dd>
                {%- endif -%}

            </dl>
        {% endif %}

    </div>

    <ul class="record_actions">
        <li>
            <a href="{{ path('chill_event__event_show', { 'event_id': event.id} ) }}" class="btn btn-view">
                {{ 'Show the event'|trans }}
            </a>
        </li>
    </ul>
</div>
