<div class="row">
    <div class="col-md-3 p-3">
        <ul class="list-group">
            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Titre</span>

                {{ entity.title }}
            </li>
            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Catégories</span>

                {% for category in entity.categories %}
                    <a class="d-block" href="{{ path('admin_blog_category_show', {entity: category.id}) }}">{{ category.title }}</a>
                {% else %}
                    -
                {% endfor %}
            </li>
            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Tags</span>

                {% for tag in entity.tags %}
                    <span class="d-block">{{ tag.label }}</span>
                {% else %}
                    -
                {% endfor %}
            </li>
            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Slug</span>

                {{ entity.slug }}
            </li>
        </ul>
        {% if entity.isQuick %}
            <ul class="list-group mt-3">
                <li class="list-group-item">
                    <span class="font-weight-bold pb-2 d-block">QUICK</span>
                </li>
                <li class="list-group-item">
                    <span class="font-weight-bold pb-2 d-block">URL</span>

                    <a href="{{ entity.quickUrl }}" target="_blank">
                        {{ entity.quickUrl }}
                    </a>
                </li>
                <li class="list-group-item">
                    <span class="font-weight-bold pb-2 d-block">Image</span>

                    {% if entity.quickImage %}
                        <a href="{{ entity.quickImage }}" target="_blank">
                            <img src="{{ entity.quickImage }}" class="img-fluid">
                        </a>
                    {% else %}
                        -
                    {% endif %}
                </li>
                <li class="list-group-item">
                    <span class="font-weight-bold pb-2 d-block">Vidéo</span>

                    {% if entity.quickVideo %}
                        <a href="{{ entity.quickVideo }}" target="_blank">
                            {{ entity.quickVideo }}
                        </a> ({{ [entity.quickVideoWidth, entity.quickVideoHeight]|join(' x ') }})
                    {% else %}
                        -
                    {% endif %}
                </li>
            </ul>
        {% endif %}
    </div>
    <div class="col-md-6 p-3" id="post-content">
        <div class="font-weight-bold pb-2">Contenu</div>

        {% if entity.contentFormat == 'html' %}
            {{- entity.content|murph_url|file_attributes|post -}}
        {% elseif entity.contentFormat == 'markdown' %}
            {{- entity.content|murph_url|file_attributes|markdown('post') -}}
        {% elseif entity.contentFormat == 'editorjs' %}
            {{- entity.content|murph_url|file_attributes|editorjs_to_html|raw -}}
        {% endif %}

        {% if entity.notebook %}
            <hr>

            <div class="font-weight-bold pb-2">Carnet de notes</div>

            {{ entity.notebook|markdown('post') }}
        {% endif %}
    </div>
    <div class="col-md-3 p-3">
        <ul class="list-group">
            <li class="list-group-item">
                <span class="font-weight-bold pb-3 d-block">Image</span>

                {% if entity.image %}
                    <figure>
                        <img src="{{ asset(entity.image.pathname) }}" class="img-fluid">
                    </figure>
                {% else %}
                    -
                {% endif %}
            </li>

            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Statut</span>

                {% if entity.status == 0 %}
                    Brouillon
                {% else %}
                    Publié
                {% endif %}
            </li>
            <li class="list-group-item">
                <span class="font-weight-bold pb-2 d-block">Date de publication</span>

                {{ entity.publishedAt ? entity.publishedAt|date('d/m/Y H:i') : '-' }}
            </li>
        </ul>
    </div>
</div>

<style>
    #post-content img {
        max-width: 100%;
    }
</style>

