{% extends "@templates/"~template~"/view/base.html.twig" %}


{% block javascript %}
    {{ parent() }}
    <script src="{{ asset('media/Public/js/index.js') }}"></script>
{% endblock %}


{% block content %}
<section class="article">
    <div class="grid-container">
        <div class="grid-x">
            <div class="cell">
                <h1>Mapa strony: Kategoria newsów</h1>
            </div>
        </div>
        <div class="grid-x">
            <div class="cell">
                <label for="searchIndexPage">Szukaj:</label>
                <input type="search" id="searchIndexPage">
            </div>
        </div>
        <div class="siteMap">
            <div class="grid-x small-up-1 medium-up-2">
                <div class="cell">
                    <h2>{{ category.name }}</h2>
                    <nav>
                        <ul>
                            {% set month = '' %}
                            {% for newsItem in getNewsNoLimit(category.id) %}
                                {% set metaData = getMetaArrayValues(newsItem) %}
                                {% if params.splitNewsPerMonth and newsItem.dateOfPublication|date('F Y') != month %}
                                    {% set month = newsItem.dateOfPublication|date('F Y') %}
                                    <li class="monthIndexNews">
                                        {{ month }}
                                    </li>
                                {% endif %}
                                <li>
                                    <a href="{{ metaData.canonical }}" title="{{ newsItem.title }}">
                                        {% if(params.showImagePublicIndex and metaData.image is not null) %}
                                            <span class="imagesData imagesInfoSpan" data-img="{{ metaData.image }}" data-alt="{{ metaData.title }} - {{ metaData.description }}"></span>
                                        {% endif %}
                                        <span>{{ newsItem.title }}</span>
                                    </a>
                                </li>
                            {% endfor %}
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</section>
{% endblock %}
