43 lines
2.1 KiB
Twig
43 lines
2.1 KiB
Twig
<article class="post-card gradient--{{ card.parent_slug }}">
|
|
<a href="{{ card.card_link ?: post.link }}" class="gradient-container">
|
|
{% if card.card_image %}
|
|
<img src="{{ card.card_image }}" alt="{{ post.title|bilingual(current_language) }}" loading="lazy">
|
|
{% else %}
|
|
<h2>{{ post.title|bilingual(current_language) }}</h2>
|
|
{% endif %}
|
|
</a>
|
|
<div class="contextual-infos">
|
|
<div class="authors">
|
|
{% set autres = post.meta('autrepersonnes') %}
|
|
{% set autres_list = autres ? autres|split(', ') : [] %}
|
|
{% set membres_count = card.card_membres|length %}
|
|
{% set total = membres_count + autres_list|length %}
|
|
{% set slots_left = 3 - membres_count %}
|
|
{% for membre in card.card_membres|slice(0, 3) %}
|
|
<span><a href="{{ membre.url }}">{{ membre.name }}</a></span>
|
|
{% endfor %}
|
|
{% if slots_left > 0 and autres_list|length > 0 %}
|
|
<span>{{ autres_list|slice(0, slots_left)|join(', ') }}</span>
|
|
{% endif %}
|
|
{% if total > 3 %}…{% endif %}
|
|
</div>
|
|
{% if show_category %}
|
|
<div class="date-category">
|
|
<time class="date" datetime="{{ card.card_event_date_iso ?: post.date('Y-m-d') }}">{{ card.card_event_date ?: post.date('d/m/Y') }}</time>
|
|
{% if card.card_type %}
|
|
<a class="card-type" href="{{ card.card_category_url }}">{{ card.card_type }}</a>
|
|
{% elseif card.card_category_name and not type_only %}
|
|
<a class="card-type" href="{{ card.card_category_url }}">{{ card.card_category_name }}</a>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<time class="date" datetime="{{ card.card_event_date_iso ?: post.date('Y-m-d') }}">{{ card.card_event_date ?: post.date('d/m/Y') }}</time>
|
|
{% endif %}
|
|
</div>
|
|
{% if card.card_image %}
|
|
<h2 class="title-bottom">
|
|
<a href="{{ card.card_link ?: post.link }}">{{ post.title|bilingual(current_language) }}</a>
|
|
</h2>
|
|
{% endif %}
|
|
</article>
|