misuzu/templates/news/index.twig

41 lines
1.5 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' %}
{% set canonical_url = url_construct('/news.php', {'o':posts_offset}) %}
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
<div class="container" style="padding: 5px;">
{{ pagination(posts_count, posts_take, posts_offset, '/news.php', true) }}
</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 %}