Newer
Older
pre-www / src / pages / ateneo / archivio-bandi.twig
{% extends "../../layout/archive.twig" %}

{% set type = "tenders" %}

{% block archive_col_1 %}
    <nav aria-label="Breadcrumbs" class="breadcrumbs {{block.classes}}">
        <ul>
            <li><a href="#">Ateneo</a></li>                
            <li><h1 aria-current="page">Archivio bandi</h1></li>
        </ul>
    </nav>
{% endblock %}

{% block archive_col_2 %}
    <div class="posts-archive-description">
        <p>{{post_type.pages[22].description}}</p>
    </div>
{% endblock %}

{% block filters %}

    <div>
        {% set archive_filters = {
            "key": "filters",
            "classes": "",
            "content": {
                "items": [
                    {
                        "type": "term",
                        "post_type": type,
                        "id": 0
                    },
                    {
                        "type": "term",
                        "post_type": type,
                        "id": 1
                    },
                    {
                        "type": "term",
                        "post_type": type,
                        "id": 2
                    }
                ],
                "has_search": true
            }
            } %}
        {% include "../../blocks/filters.twig" with {"block": archive_filters } %}
    </div>

{% endblock %}

{% block posts %}

    {% for post in post_type.tenders.items %}
        {% if post.status.class == "archived" %}
            <div class="post-row{% if post.status %} post-row--{{post.status.class}}{% endif %}">
                <div class="post-row__inner">

                    <div>
                        <div class="post-row-date tender-date">
                            {% if post.status.class == 'expired' or post.status.class == 'completed' %}Scaduto{% endif %}

                            {% if post.date is iterable %}
                                <div>
                                    <span>Prorogato al {{post.date[1]|date('d.m.Y, H:s')}}</span>
                                    <span>Scadenza {{post.date[0]|date('d.m.Y, H:s')}}</span>
                                </div>
                            {% else %}
                                <span>Scadenza {{post.date|date('d.m.Y, H:s')}}</span>    
                            {% endif %}
                            
                        </div>
                        <span class="status status--{{post.status.class}}"><span></span>{{post.status.label}}</span>
                    </div>

                    <div class="post-row-content">

                        <a href="{{post.url}}" class="post-row-title">{{post.title}}</a>

                        <div class="block-container block-grid-list">
                            <div class="block-grid-list__inner">

                                {% for id in post.terms|slice(0,1) %}
                                    {% set parent = id[0] %}
                                    {% set terms = id[1] %}
                                    {% set taxonomy = taxonomies.tenders.terms[parent] %}
                                    <div>
                                        <p>{{taxonomy.name}}</p>
                                        <p>
                                        {% for term in terms %}
                                            {% set term = taxonomies.tenders.terms[parent].items[term] %}
                                            <span>{{term.name}}</span>{% if not loop.last %}, {% endif %}
                                        {% endfor %}
                                        </p>
                                    </div>
                                {% endfor %}
                                <div>
                                    <p>Posti disponibili</p>
                                    <p>{{post.seats}}</p>
                                </div>
                                {% for id in post.terms|slice(1) %}
                                    {% set parent = id[0] %}
                                    {% set terms = id[1] %}
                                    {% set taxonomy = taxonomies.tenders.terms[parent] %}
                                    <div>
                                        <p>{{taxonomy.name}}</p>
                                        <p>
                                        {% for term in terms %}
                                            {% set term = taxonomies.tenders.terms[parent].items[term] %}
                                            <span>{{term.name}}</span>{% if not loop.last %}, {% endif %}
                                        {% endfor %}
                                        </p>
                                    </div>
                                {% endfor %}
                                {% for item in post.info %}
                                    <div>
                                        <p>{{item.label}}</p>
                                        <p>{{item.text}}</p>
                                    </div>
                                {% endfor %}

                            </div>
                        </div>

                    </div>
                </div>
                <div class="post-row__footer">
                    {% set tender_links = {
                        "key": "links-list",
                        "classes": "",
                        "links_size": "sm",
                        "content": {
                            "list": [
                                {
                                    "name": "Vedi i materiali e l'esito",
                                    "url": "#",
                                }
                            ]
                        }
                    } %}
                
                    {% include "../../blocks/links-list.twig" with {'block': tender_links } %}
                </div>
            </div>
        {% endif %}
        
    {% endfor %}

{% endblock %}