misuzu/views/mio/news/index.twig

43 lines
1.7 KiB
Twig
Raw Normal View History

2018-04-14 02:58:53 +00:00
{% extends '@mio/news/master.twig' %}
{% from '@mio/macros.twig' import pagination %}
2018-04-16 00:33:54 +00:00
{% from '@mio/news/macros.twig' import news_preview %}
2018-04-14 02:58:53 +00:00
{% set title = 'News' %}
2018-07-07 20:11:16 +00:00
{% set canonical_url = '/news.php'|url_construct({'o':posts_offset}) %}
2018-04-14 02:58:53 +00:00
{% block news_content %}
2018-04-16 00:33:54 +00:00
<div class="container news__container">
<div class="container__title news__container__title">News</div>
<div class="container__content news__container__content">
<div class="news__preview__listing">
2018-04-14 02:58:53 +00:00
{% for post in posts %}
2018-04-16 00:33:54 +00:00
{{ news_preview(post) }}
2018-04-14 02:58:53 +00:00
{% endfor %}
</div>
2018-04-16 00:33:54 +00:00
<div class="news__sidebar">
<div class="container news__list">
<div class="container__title">
Categories
</div>
<div class="container__content">
{% for category in categories %}
2018-05-16 02:58:21 +00:00
<a class="news__list__item news__list__item--kvp" href="/news.php?c={{ category.category_id }}">
<div class="news__list__name">
{{ category.category_name }}
</div>
<div class="news__list__value">
{{ category.count }} post{{ category.count == 1 ? '' : 's' }}
</div>
</a>
2018-04-16 00:33:54 +00:00
{% endfor %}
</div>
2018-04-14 02:58:53 +00:00
</div>
{{ pagination(posts_count, posts_take, posts_offset, '/news.php') }}
2018-04-14 02:58:53 +00:00
</div>
</div>
</div>
{% endblock %}