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

{% load unicms_contexts %}
{% load unicms_menus %}
{% load unicms_template_unical %}


{% load_current_item_from_menu as current_item %}

{% block item_publication %}
{% if current_item.publication %}
{% load_item_publication current_item as publication %}
{% include "unical_publication_full_view.html" with publication=publication %}
<hr class="mb-5" />
{% endif %}
{% endblock item_publication %}

{% load_item_childs current_item as childs %}

{% for item in childs %}

{% call obj=item method='link' request=request as link %}
{% load_item_inherited_content item as publication %}

<div class="row mb-4">

    <div class="col-12 col-lg-4 mt-lg-2 mb-md-3 mb-lg-0">
        {% if publication.presentation_image %}
        <div class="img-responsive-wrapper">
            <div class="img-responsive img-responsive-panoramic">
                <figure class="img-wrapper">
                  <a href="{{ link }}">
                    <img src="{{ publication.image_url }}"
                         title="{{ publication.presentation_image.description.title }}"
                         alt="{{ publication.presentation_image.description }}">
                  </a>
                </figure>
            </div>
        </div>
        {% else %}
        <div class="w-100" style="height: 160px; background: #ccc"></div>
        {% endif %}
    </div>

    <div class="col-12 col-lg-8 pl-lg-4">
        <h3>
            <a href="{{ link }}" class="no-color">
                {{ item.name }}
            </a>
        </h3>

        {{ publication.subheading }}

        {% if item.get_childs %}

        {% load_item_childs item as childs %}

        <div class="row mt-3">
            <div class="col">
            {% for child in childs %}
                {% call obj=child method='link' request=request as child_link %}
                {% if child_link %}
                <span
                    class="badge badge-grey-unical square-corners mb-3 mr-3 ml-0 pr-5 p-2 mw-100"
                    style="font-size: 100%">
                    <a class="no-color" href="{{ child_link }}">
                        <b>{{ child.name }}</b>
                    </a>
                </span>
                {% endif %}
            {% endfor %}
            </div>
        </div>
        {% endif %}
    </div>
</div>
{% if not forloop.last %}
<hr class="my-4 bordeaux-unical-bg">
{% endif %}
{% endfor %}


