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

{% load unicms_contexts %}


{% if publications %}
<div class="row d-lg-flex">
    {% for pub in publications|slice:":2" %}
    <div class="col-12">
        <!--start card-->
        <div class="card-wrapper card-space">
            <div class="card card-bg no-after">
                {% if pub.publication.presentation_image %}
                <a style="" href="{{ pub.url }}">
                    <img src="{{ pub.publication.image_url }}" title="img title" alt="imagealt" style="width: 100%">
                </a>
                {% endif %}
                <div class="card-body">
                    <div class="etichetta">
                        <span>
                            {% for cat in pub.publication.categories|slice:":3" %}
                                {% if forloop.counter > 1 %}&nbsp;&middot;&nbsp;{% endif %}
                                <a href="{% call obj=pub method='get_url_list' category_name=cat %}" style="color: #176fc1;">{{ cat }} </a>
                            {% endfor %}
                        </span>
                    </div>

                    <h4 class="card-title">
                        <a style="text-decoration: none; color: #17324d;" href="{{ pub.url }}">
                            {{ pub.publication.title }}
                        </a>
                    </h4>
                    {% if not pub.publication.presentation_image %}
                        <p class="card-text">{{ pub.publication.subheading|truncatechars:100 }}</p>
                    {% endif %}
                    <a href="#">
                        <svg class="icon">
                            <use xlink:href="{% static 'svg/sprite.svg' %}#it-share"></use>
                        </svg>
                    </a>
                </div>
            </div>
        </div>
        <!--end card-->
    </div>
    {% endfor %}
</div>
{% endif %}
