{% extends 'manage/news/master.twig' %}
{% from 'macros.twig' import pagination, container_title %}

{% block manage_content %}
    <div class="container">
        {{ container_title('News Posts') }}

        <a href="{{ url('manage-news-post') }}" class="input__button">New Post</a>

        {% for post in news_posts %}
            <p>
                <a href="{{ url('manage-news-post', {'post': post.id}) }}" class="input__button">{{ post.id }}</a>
                <a href="{{ url('manage-news-category', {'category': post.categoryId}) }}" class="input__button">Cat: {{ post.categoryId }}</a>
                {{ post.isFeatured }},
                {{ post.user.id }},
                {{ post.title }},
                {{ post.scheduledTime|date('r') }},
                {{ post.createdTime|date('r') }},
                {{ post.updatedTime|date('r') }},
                {{ post.deletedTime|date('r') }},
                {{ post.commentsCategoryId }}
            </p>
        {% endfor %}

        {{ pagination(posts_pagination, url('manage-news-posts')) }}
    </div>
{% endblock %}
