This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/news/category.twig

23 lines
759 B
Twig

{% 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 %}
</div>
{% endblock %}