{% extends 'layouts/base.twig' %}

{% block content %}
    {# <h1>SINGLE ARTÍCULOS</h1> #}

    <div class="container">
        <article class="post-type-{{ post.type }} mt-5" id="post-{{ post.id }}">

            <span class="my-5 position-relative fs-5 fw-bold sp-module-title">
                {% if post.category %}
                    {{ post.category }}
                {% else %}
                    {{ post.post_type == 'opinion' ? 'Opinión' : 'Sin categoría' }}
                {% endif %}
            </span>

            <section class="article-content mt-5 border-dark border-top">

                <h1 class="article-h1">{{ post.title }}</h1>
                <p class="blog-author mt-4 mb-3 border-dark border-bottom">
                    <span>{{ __('Autor', 'Sindikatua')}}:</span>
                    {% if post.post_type == 'opinion' %}
                        <span>{{ post.author_alias }}</span>
                    {% else %}
                        <span>{{ post.author.name }}</span>
                    {% endif %}
                    <span>&bull;</span>
                    <time datetime="{{ post.date|date('Y-m-d H:i:s') }}">{{ post.date }}</time>
                </p>

                <div class="article-body">{{ post.content }}</div>
            </section>
            
            <!-- comments -->
            {# <p class="mt-5 border-dark border-top fst-italic">{{ __('No se puede comentar', 'Sindikatua') }}</p> #}

            {# <section class="comment-box mt-5 p-2 border-dark border-top">
                <div class="comments">
                    {% if post.comments %}
                        <!-- <h2>Comentarios</h2>  -->
                        
                        {% for cmt in post.comments %}
                            {% include 'partials/comment.twig' with {
                                comment: cmt
                            } %}
                        {% endfor %}
                    {% endif %}
                </div>

                {% if post.comment_status == 'closed' %}
                    <p>{{ __('No se puede comentar', 'Sindikatua') }}</p>
                {% else %}
                    {% include 'partials/comment-form.twig' %}
                {% endif %}
            </section> #}

        </article>
    </div>
{% endblock %}
