{% extends 'master.twig' %}
{% from 'macros.twig' import news_post %}
{% set title = 'News' %}
{% set posts = category.posts|batch(3) %}
{% set paginationPages = posts|keys %}
{% set paginationUrl %}{{ route('news.category', category.name) }}{% endset %}
{% block content %}
<div class="content news">
<div class="content__header">News</div>
{% for post in posts[get.page|default(1) - 1] %}
{{ news_post(post.id, post.text, post.created, post.userData, post.title, post.commentCount) }}
{% endfor %}
{% if posts|length > 1 %}
<div>
{% include 'elements/pagination.twig' %}
<div class="clear"></div>
</div>
{% endif %}
{% endblock %}