{% load i18n %}
{% load static %}

{% load unicms_contexts %}
{% load unicms_templates %}

{% settings_value "CMS_PUBLICATION_LIST_PREFIX_PATH" as page_news_suffix %}

{% if publications %}
<div class="row d-lg-flex">

    {% for pub in publications %}
    <div class="col-12 col-lg-3 mb-lg-3">
        <div class="card-wrapper">
            <div class="card card-bg no-after">
                <div class="card-body">
                    <div class="category-top">
                        <span>{% trans "Published" %}: {{ pub.date_start|date:"d/m/Y, H:i" }}</span>
                        {% include "includes/edit_news.html" with item=pub %}
                    </div>
                    <h5 class="card-title">
                        <a class="no-color" href="{{ pub.url }}" title="{{ pub.publication.title }}">
                            {{ pub.publication.title }}
                        </a>
                    </h5>
                    <p class="card-text">
                        {{ pub.publication.subheading|truncatechars:135 }}
                    </p>
                </div>
            </div>
        </div>
    </div>
    {% endfor %}

</div>

<p class="mt-3 ms-2">
    <a href="{{ page_news_suffix }}" class="no-color">
        <span class="text-black fw-bold">
            <svg class="icon me-2">
                <use xlink:href="{% static '/svg/sprites.svg' %}#it-arrow-right-circle"></use>
            </svg>
            {% trans "Go to all news" %}
        </span>
    </a>
</p>
{% endif %}
