{% extends "layout_plan.html" %}
{% block title %}Статьи{% endblock %}
{% block styles %}
    <style>
        .select2-container {
            width: 100% !important;
        }
    </style>
{% endblock %}
{% block content %}
    {% if q %}
        <h1>Поиск: «{{ q }}»</h1>
    {% else %}
        <h1>Все статьи</h1>
    {% endif %}
    <div class="row">
        <div class="col-12">
            <a class="btn btn-light" href="{% url 'articles_whitelisted' %}">Добавить статью из регулярной
                рубрики</a>
            <a class="btn btn-light" href="{% url 'articles_advert' %}">Добавить рекламный материал</a>
        </div>
    </div>

    <hr/>
    <ul class="nav nav-tabs">
        <li class="nav-item">
            <a class="nav-link {% if filter_ == none %}active{% endif %}" href="{% url 'articles_index' %}">Недавние</a>
        </li>
        <li class="nav-item">
            <a class="nav-link {% if filter_ == 'all' %}active{% endif %}"
               href="{% url 'articles_index' %}?filter=all">Все</a>
        </li>
        <li class="nav-item">
            <a class="nav-link {% if filter_ == 'self' %}active{% endif %}"
               href="{% url 'articles_index' %}?filter=self">Свои</a>
        </li>
        <li class="nav-item">
            <a class="nav-link {% if filter_ == 'overdue' %}active{% endif %}"
               href="{% url 'articles_index' %}?filter=overdue">Просрочено</a>
        </li>
        <li class="nav-item">
            <a class="nav-link {% if filter_ == 'vault' %}active{% endif %}"
               href="{% url 'articles_index' %}?filter=vault">Копилка</a>
        </li>
    </ul>
    <br/>


    {% with posts=posts interactive=True %}
        {% include 'magplan/partials/posts_table.html' %}
    {% endwith %}
{% endblock %}
