{% if is_paginated %}
    {% include 'partial/pagination.html' %}
{% endif %}

{% for article in articles %}
    <div class="box">
        <h3><a href="{% url "article_detail" article.pk %}">{{ article.title }}</a></h3>
        <p>
            <label for="selected_articles-{{ article.pk }}">Select:</label>
            <input type="checkbox" name="selected_articles"
                   id="selected_articles-{{ article.pk }}" value="{{ article.pk }}">
        </p>
        <p>Статус: ({{ article.status }} | {{ article.get_status_display }})</p>
        <p>
            <a href="{% url 'user-detail' article.author_id %}">{{ article.author }}</a>
            | {{ article.created_at|date:"d.m.Y H:i:s" }}
        </p>
        <p>Published at: {{ article.publish_at|date:"d.m.Y H:i:s" }}</p>
        {% if perms.articles.change_article or article.author == request.user %}
            <p><a href="{% url 'article_update' article.pk %}">Update</a></p>
        {% endif %}
        {% if perms.articles.delete_article or article.author == request.user %}
            <p><a href="{% url 'article_delete' article.pk %}">Delete</a></p>
        {% endif %}
    </div>
{% empty %}
    <h2 class="text-center">Нет статей</h2>
{% endfor %}

{% if is_paginated %}
     {% include 'partial/pagination.html' %}
{% endif %}
