{% if paths_base == null %}
    {% set paths_base = '../..' %}
{% endif %}

{% extends "base.twig" %}

{% set bodyClasses = 'page has-primary-bg single-contact' %}

{% set post = post_type.people.items[currentPost] %}

{% block content %}

    {% for block in post.blocks %}
        {% include '../blocks/'~block.key~'.twig' with {'block': block } %}
    {% endfor %}

    <section class="content-section">
        <div class="block-container">
            <div class="columns">
                <div class="w-full lg:w-1/2 column person-info">
                    {% include '../blocks/grid-list.twig' with {'block': post.people_info } %}
                </div>
                <div class="w-full lg:w-1/2 column person-img">
                    {% include '../layout/partials/picture.twig' with {'image': post.image } %}
                </div>
            </div>
        </div>
    </section>

    <section class="content-section">
        {% include '../blocks/composition/composition-files-list.twig' with {'block': post.people_profile } %}
    </section>
    
    <section class="content-section">
        {% include '../blocks/composition/composition-links-list.twig' with {'block': post.people_teaching } %}
    </section>
    
    <section class="content-section">
        
        {# Titolo #}
        {% set related_degree_title = 
            {
                "key": "title",
                "tag": "h2",
                "classes": "block-title--sm block-title--divider",
                "content": {
                    "title": "Corsi di laurea di pertinenza"
                }
            }
        %}
        {% include '../blocks/title.twig' with {'block': related_degree_title } %}

        {# Query posts #}
        {% set related_degree_cards = 
            {
                "key": "card",
                "tag": "h2",
                "classes": "block-title--sm block-title--divider",
                "content": {
                    "title": "Corsi di laurea di pertinenza"
                }
            }
        %}
        <div class="cards-container">
            <div class="cards-container__inner">
                {% for card in post.people_degrees.items %}
                    {% set title = post_type.degrees.items[card].title %}
                    <a href="{{card.url}}" class="card card--alt-invert">
                        <p>{{post.people_degrees.base}} {{title}}</p>
                        <svg width="27" height="20" viewBox="0 0 27 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M22.7112 9.00003L15.9329 1.67943L17.4004 0.320618L26.3628 10L17.4004 19.6794L15.9329 18.3206L22.7112 11H0V9.00003H22.7112Z" fill="currentColor"/></svg>
                    </a>
                {% endfor %}
            </div>
        </div>

    </section>

{% endblock %} 
