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

{% block meta %}{{ getMeta(news)|raw }}{% endblock %}

{% block content %}
<section class="article">
    <div class="grid-container">
    <div class="grid-x">
        <div class="cell">
            <h1>{{ news.title }}</h1>
        </div>
    </div>
    <div class="grid-x">
        <div class="cell">
            <div class="categories">
                <span><small>Kategorie:</small></span>
                {% for category in news.categories %}
                    <a href="{{ url('wi_front_news_by_category_index', {'id': category.id, 'slug':slugify(category.name)}) }}">{{ category.name }}</a>,
                {% endfor %}
            </div>
        </div>
    </div>
    <div class="grid-x">
        <div class="cell">
            <article class="fullContent">{{ news.content|raw }}</article>
        </div>
    </div>


    {% if news.gallery %}
        <div class="grid-x grid-margin-x">
            {% for photo in news.gallery.photos %}
                <a href="{{ asset(photo.photo) }}" title="{{ photo.title }}" data-lightbox="lightbox" data-title="{{ photo.title }}" data-alt="{{ photo.title }}">
                    <img src="{{ asset(photo.photo('thumbnailS')) }}" alt="{{ photo.title }}" />
                </a>
            {% endfor %}
        </div>
    {% endif %}

    <a href="{{ path('wi_front_news_pdf', { 'id': news.id }) }}">Pobierz jako PDF</a>

    {% include '@templates/'~template~'/view/News/Components/comments.html.twig' %}
    </div>
</section>
{% endblock %}
{% block javascript %}
    <script src="{{ asset('media/Public/vendor/lightbox/dist/js/lightbox.min.js') }}"></script>
    {{ parent() }}
    <script>
    var news_id = {{ news.id }};
    </script>
    <script src="{{ asset('media/Public/js/comment.js') }}"></script>
{% endblock %}
