misuzu/templates/changelog/index.twig
flash 383e2ed0e0 Rewrote the user information class.
This one took multiple days and it pretty invasive into the core of Misuzu so issue might (will) arise, there's also some features that have gone temporarily missing in the mean time and some inefficiencies introduced that will be fixed again at a later time.
The old class isn't gone entirely because I still have to figure out what I'm gonna do about validation, but for the most part this knocks out one of the "layers of backwards compatibility", as I've been referring to it, and is moving us closer to a future where Flashii actually gets real updates.
If you run into anything that's broken and you're inhibited from reporting it through the forum, do it through chat or mail me at flashii-issues@flash.moe.
2023-08-02 22:12:47 +00:00

65 lines
2.1 KiB
Twig

{% 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),
'tags': changelog_tags,
'page': changelog_pagination.page < 2 ? 0 : changelog_pagination.page,
}) %}
{% if is_date or is_user %}
{% set title = title ~ ' »' %}
{% set first_change_info = changelog_infos[0] %}
{% if is_date %}
{% set first_change_date = first_change_info.date is defined ? first_change_info.date : first_change_info.change.date %}
{% set title = title ~ ' ' ~ first_change_date %}
{% endif %}
{% if is_user %}
{% set title = title ~ ' by ' ~ first_change_info.user.name %}
{% endif %}
{% else %}
{% set feeds = [
{
'type': 'rss',
'title': '',
'url': url('changelog-feed-rss'),
},
{
'type': 'atom',
'title': '',
'url': url('changelog-feed-atom'),
},
] %}
{% endif %}
{% block content %}
<div class="container changelog__container">
{{ container_title('<i class="fas fa-wrench fa-fw"></i> ' ~ title) }}
{{ changelog_listing(changelog_infos, is_date) }}
{% if not is_date %}
<div class="changelog__pagination">
{{ pagination(changelog_pagination, url('changelog-index'), null, {'date':changelog_date_fmt, 'user':changelog_user.id|default(0)})}}
</div>
{% endif %}
</div>
{% if is_date %}
<div class="container">
{{ container_title('<i class="fas fa-comments fa-fw"></i> Comments') }}
{{ comments_section(comments_info) }}
</div>
{% endif %}
{% endblock %}