{% extends 'changelog/master.twig' %} {% from 'macros.twig' import pagination, container_title %} {% from 'changelog/macros.twig' import changelog_listing %} {% from '_layout/comments.twig' import comments_section %} {% set is_date = changelog_date > 0 %} {% set is_user = changelog_user is not null %} {% set title = 'Changelog' %} {% set changelog_date_fmt = changelog_date|default(false) ? changelog_date|date('Y-m-d') : '' %} {% set canonical_url = url('changelog-index', { 'date': changelog_date_fmt, 'user': changelog_user.id|default(0), 'page': changelog_pagination.page < 2 ? 0 : changelog_pagination.page, }) %} {% if is_date or is_user %} {% set title = title ~ ' ยป' ~ (is_date ? ' ' ~ changelog_infos[0].date : '') ~ (is_user ? ' by ' ~ changelog_infos[0].user.username : '') %} {% else %} {% set feeds = [ { 'type': 'rss', 'title': '', 'url': url('changelog-feed-rss'), }, { 'type': 'atom', 'title': '', 'url': url('changelog-feed-atom'), }, ] %} {% endif %} {% block content %}
{{ container_title(' ' ~ title) }} {{ changelog_listing(changelog_infos, is_date) }} {% if not is_date %}
{{ pagination(changelog_pagination, url('changelog-index'), null, {'date':changelog_date_fmt, 'user':changelog_user.id|default(0)})}}
{% endif %}
{% if is_date %}
{{ container_title(' Comments') }} {{ comments_section(changelog_infos[0].commentsCategory, comments_user) }}
{% endif %} {% endblock %}