misuzu/templates/news/category.twig

71 lines
2.4 KiB
Twig
Raw Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'news/master.twig' %}
{% from 'macros.twig' import pagination, container_title %}
{% from 'news/macros.twig' import news_preview %}
2023-07-15 17:02:46 +00:00
{% set title = news_category.name ~ ' :: News' %}
{% set manage_link = url('manage-news-category', {'category': news_category.id}) %}
2022-09-13 13:14:49 +00:00
{% set canonical_url = url('news-category', {
2023-07-15 17:02:46 +00:00
'category': news_category.id,
2022-09-13 13:14:49 +00:00
'page': news_pagination.page > 2 ? news_pagination.page : 0,
}) %}
{% set feeds = [
{
'type': 'rss',
'title': '',
2023-07-15 17:02:46 +00:00
'url': url('news-category-feed-rss', {'category': news_category.id}),
2022-09-13 13:14:49 +00:00
},
{
'type': 'atom',
'title': '',
2023-07-15 17:02:46 +00:00
'url': url('news-category-feed-atom', {'category': news_category.id}),
2022-09-13 13:14:49 +00:00
},
] %}
{% block content %}
<div class="news__container">
<div class="news__preview__listing">
2023-07-15 17:02:46 +00:00
{% for post in news_posts %}
2022-09-13 13:14:49 +00:00
{{ news_preview(post) }}
{% endfor %}
<div class="container" style="padding: 4px; display: {{ news_pagination.pages > 1 ? 'block' : 'none' }}">
2023-07-15 17:02:46 +00:00
{{ pagination(news_pagination, url('news-category', {'category': news_category.id})) }}
2022-09-13 13:14:49 +00:00
</div>
</div>
<div class="news__sidebar">
<div class="container news__list">
2023-07-15 17:02:46 +00:00
{{ container_title('News » ' ~ news_category.name) }}
2022-09-13 13:14:49 +00:00
<div class="container__content">
2023-07-15 17:02:46 +00:00
{{ news_category.description }}
2022-09-13 13:14:49 +00:00
</div>
</div>
<div class="container">
{{ container_title('Feeds') }}
<div class="news__feeds">
2023-07-15 17:02:46 +00:00
<a href="{{ url('news-category-feed-atom', {'category': news_category.id}) }}" class="news__feed">
2022-09-13 13:14:49 +00:00
<div class="news__feed__icon">
<i class="fas fa-rss"></i>
</div>
<div class="news__feed__type">
Atom
</div>
</a>
2023-07-15 17:02:46 +00:00
<a href="{{ url('news-category-feed-rss', {'category': news_category.id}) }}" class="news__feed">
2022-09-13 13:14:49 +00:00
<div class="news__feed__icon">
<i class="fas fa-rss"></i>
</div>
<div class="news__feed__type">
RSS
</div>
</a>
</div>
</div>
</div>
</div>
{% endblock %}