misuzu/templates/news/index.twig

43 lines
1.6 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'news/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import pagination, container_title %}
2018-08-15 01:12:58 +00:00
{% from 'news/macros.twig' import news_preview %}
2018-04-14 02:58:53 +00:00
{% set title = 'News' %}
2019-01-03 00:33:02 +00:00
{% set canonical_url = url_construct('/news.php', {
'p': news_pagination.page > 2 ? news_pagination.page : 0,
}) %}
2018-10-10 12:25:18 +00:00
{% set manage_link = '/manage/news.php?v=index' %}
2018-04-14 02:58:53 +00:00
{% block content %}
<div class="news__container">
<div class="news__preview__listing">
{% for post in posts %}
{{ news_preview(post) }}
{% endfor %}
2018-10-25 00:23:26 +00:00
2019-01-03 00:33:02 +00:00
<div class="container" style="padding: 4px; display: {{ news_pagination.pages > 1 ? 'block' : 'none' }}">
{{ pagination(news_pagination, '/news.php', null, null, 'page') }}
2018-10-25 00:23:26 +00:00
</div>
</div>
2018-04-16 00:33:54 +00:00
<div class="news__sidebar">
<div class="container news__list">
2018-10-22 19:53:21 +00:00
{{ container_title('Categories') }}
<div class="container__content">
{% for category in categories %}
<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">
2018-10-10 09:21:57 +00:00
{{ category.posts_count }} post{{ category.posts_count == 1 ? '' : 's' }}
</div>
</a>
{% endfor %}
2018-04-14 02:58:53 +00:00
</div>
</div>
</div>
</div>
{% endblock %}