templates/web/news/news-detail.html.twig line 1

  1. {% extends "base.html.twig" %}
    {% block body %}
        <div class="container">
            <article>
                <h1>
                    {% if category.title %}
                       {{ category.title }}
                    {% else %}
                        {{ category.name }}
                    {% endif %}
                </h1>
                {{ category.html|raw }}
            </article>
        </div>
    
        {% if get_category_uploads_by_group_type(category, 1)|length > 0 %}
            <section class="container">
                <h2>{% trans %}prilohy{% endtrans %}</h2>
                <ul class="list-icone list-icone--download">
                    {% for file in get_category_uploads_by_group_type(category, 1) %}
                        <li class="list-icone__item">
                            <a href="{{ asset(file.path) }}" target="_blank" rel="noopener" {% if file.extension != 'pdf' %}download{% endif %}>
                                {% if file.shortDescription %}
                                    {{ file.shortDescription }}
                                {% else %}
                                    {{ file.originalName }}
                                {% endif %}
                                {% if file.extension %}
                                    (<span class="text-uppercase">{{ file.extension }}</span>)
                                {% endif %}
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            </section>
        {% endif %}
    
        {% if get_category_uploads_by_group_type(category, 0)|length > 0 and has_gallery(category) %}
            <section class="container">
                <h2>{% trans %}fotogalerie{% endtrans %}</h2>
                <div class="gallery-grid">
                    {% for image in get_category_uploads_by_group_type(category, 0) %}
                        <div class="gallery-grid__item">
                            <a href="{{ asset(image.path) }}" class="gallery-grid__detail glightbox" data-gallery="gallery1" {% if image.shortDescription %}data-glightbox="description: .custom-desc{{ image.id }}"{% endif %}>
                                <img class="gallery-grid__photo" src="{{ asset(image.path) }}" alt="Obrázek z galerie" {% if image.shortDescription %}title="{{ image.shortDescription }}{% endif %}">
                            </a>
                            {% if image.shortDescription %}
                                <div class="glightbox-desc custom-desc{{ image.id }}">
                                    <p>{{ image.shortDescription }}</p>
                                </div>
                            {% endif %}
                        </div>
                    {% endfor %}
                </div>
            </section>
        {% endif %}
        {{ include('/web/pages/_related.html.twig', {category: category}) }}
    {% endblock %}