misuzu/templates/changelog/change.twig

108 lines
5.2 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'changelog/master.twig' %}
{% from '_layout/comments.twig' import comments_section %}
2018-07-06 01:28:06 +00:00
{% set is_valid = change|length > 0 %}
{% set title = 'Changelog » ' ~ (is_valid ? 'Change #' ~ change.change_id : 'Unknown Change') %}
{% if is_valid %}
{% set canonical_url = '/changelog.php?c=' ~ change.change_id %}
2018-07-07 01:32:09 +00:00
{% set manage_link = '/manage/changelog.php?v=change&c=' ~ change.change_id %}
{% set description = change.change_log %}
2018-07-06 01:28:06 +00:00
{% endif %}
{% block content %}
<div class="container">
<div class="container__title changelog">
{{ title }}
</div>
<div class="changelog__content">
2018-07-06 01:28:06 +00:00
{% if is_valid %}
<div class="changelog__change" id="#c{{ change.change_id }}">
<div class="changelog__change__line"
style="{{ change.action_colour|html_colour({'border-color':'%s'}) }}">
<div class="changelog__change__action {{ change.action_class is defined and change.action_class is not null ? ' changelog__change__action--' ~ change.action_class : '' }} changelog__change__action--{{ change.action_colour|colour_get_css_contrast }}"
style="{{ change.action_colour|html_colour({'background-color':'%s','border-color':'%s'}) }}">
{{ change.action_name }}
</div>
<div class="changelog__change__log">
<div class="changelog__change__log__text">
{{ change.change_log }}
</div>
2018-07-06 01:28:06 +00:00
</div>
</div>
<div class="changelog__change__row">
<div class="changelog__change__column changelog__change__column--user-info">
<a class="changelog__change__user" href="/profile.php?u={{ change.user_id }}">
<div class="avatar changelog__change__user__avatar"
style="background-image:url('/profile.php?u={{ change.user_id }}&amp;m=avatar')">
</div>
<div class="changelog__change__user__info">
2018-07-07 01:32:09 +00:00
<div class="changelog__change__user__name" style="{{ change.user_colour|html_colour }}">
2018-07-06 01:28:06 +00:00
{{ change.username }}
</div>
<div class="changelog__change__user__title">
{{ change.user_title }}
</div>
</div>
</a>
<a class="changelog__change__date"
href="/changelog.php?d={{ change.change_date }}">
<time datetime="{{ change.change_created|date('c') }}"
title="{{ change.change_created|date('r') }}">
{{ change.change_created|time_diff }}
</time>
</a>
</div>
<div class="changelog__change__column changelog__change__column--change-info">
<div class="changelog__change__text">
{% if change.change_text|length >= 1 %}
{{ change.change_text|parse_text('md')|raw }}
2018-07-06 01:28:06 +00:00
{% else %}
<p>This change has no additional notes.</p>
{% endif %}
</div>
<ul class="changelog__change__tags">
{% for tag in tags %}
<li class="changelog__change__tag"
title="{{ tag.tag_description }}">
<a href="/changelog.php?t={{ tag.tag_id }}" class="changelog__change__tag__link">
{{ tag.tag_name }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% else %}
<div class="changelog__none">
The requested change could not be found.
</div>
{% endif %}
</div>
</div>
<script>
window.addEventListener('load', () => {
if (!CSS.supports('writing-mode', 'sideways-lr'))
document.getElementsByClassName('changelog__change__action')[0].title = 'This is supposed to be sideways, but your browser doesn\'t support that.';
});
</script>
2018-08-06 22:19:35 +00:00
{% if comments is defined %}
<div class="container">
<div class="container__title">
Comments for {{ change.change_date }}
</div>
{{ comments_section(comments, comments_category, current_user|default(null), comments_perms) }}
</div>
{% endif %}
2018-07-06 01:28:06 +00:00
{% endblock %}