misuzu/templates/news/index.twig

40 lines
1.4 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'news/master.twig' %}
{% from 'macros.twig' import pagination %}
{% from '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-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 %}
</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 %}
<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>
{{ pagination(posts_count, posts_take, posts_offset, '/news.php') }}
2018-04-14 02:58:53 +00:00
</div>
</div>
{% endblock %}