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
2016-12-21 20:55:17 +01:00

25 lines
833 B
Twig

{% extends 'master.twig' %}
{% from 'macros.twig' import news_post, pagination %}
{% set title = 'News' %}
{% set posts = category.posts|batch(3) %}
{% block content %}
<div class="announce-box">
<h1>{{ category.name }}</h1>
<h3>{{ category.description }}</h3>
</div>
<div class="content news">
<div class="content__header">News</div>
{% for post in posts[get.page|default(1) - 1] %}
{{ news_post(post, true, true) }}
{% endfor %}
<div>
<a href="{{ route('news.index') }}" class="input__button"><span class="fa fa-backward"></span> Back</a>
{% if posts|length > 1 %}
{{ pagination(route('news.category', category.id), posts|keys, get.page|default(1)) }}
{% endif %}
</div>
</div>
{% endblock %}