Newer
Older
pre-www / src / layout / partials / tease-event.twig
{% if event.is_canceled %}
    {% set is_canceled = true %}
{% endif %}

<div class="tease-event {% if is_canceled %}tease-event--canceled{% endif %}">
    <div class="tease-event__date">
        <span>
            {% if event.date.start|date('D') == 'Mon' %}
                Lun
            {% elseif event.date.start|date('D') == 'Tue' %}
                Mar
            {% elseif event.date.start|date('D') == 'Wed' %}
                Mer
            {% elseif event.date.start|date('D') == 'Thu' %}
                Gio
            {% elseif event.date.start|date('D') == 'Fri' %}
                Ven
            {% elseif event.date.start|date('D') == 'Sat' %}
                Sab
            {% elseif event.date.start|date('D') == 'Sun' %}
                Dom
            {% endif %}
            
        </span>
        <span>{{event.date.start|date('d.m')}}</span>
    </div>
    <div class="tease-event__info">
        <div>
            {% if event.allday %}<span>Tutto il giorno</span>{% endif %}
            {% if event.allday and event.date.end != null and event.date.start|date('d') < event.date.end|date('d') %}
                <span>Fino al {{event.date.end|date('d.m.Y')}}</span>
            {% endif %}
            {% if event.allday != true %}
                <span>{% if is_canceled %}<span>Cancellato</span>{% endif %}{{event.date.start|date('h:s')}}</span>
            {% endif %}
            
        </div>
        <div class="tease-event__location">{{event.place}}</div>
    </div>
    <div class="tease-event__content">
        {% if event.is_canceled %}
            <span class="tease-event__title">{{event.title}}</span>
        {% else %}
            <a href="{{event.url}}" class="tease-event__title">{{event.title}}</a>
        {% endif %}
        {% if event.subtitle %}
            <p class="tease-event__subtitle">{{event.subtitle}}</p>
        {% endif %}
        <p class="tease-event__excerpt">{{event.excerpt}}</p>
    </div>
</div>