misuzu/templates/changelog/change.twig

93 lines
4.2 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'changelog/master.twig' %}
2019-09-28 19:21:23 +00:00
{% from 'macros.twig' import container_title, avatar %}
2018-08-15 01:12:58 +00:00
{% from '_layout/comments.twig' import comments_section %}
2018-07-06 01:28:06 +00:00
2018-11-17 21:59:01 +00:00
{% set title = 'Changelog » Change #' ~ change.change_id %}
{% set canonical_url = url('changelog-change', {'change': change.change_id}) %}
{% set manage_link = url('manage-changelog-change', {'change': change.change_id}) %}
2018-11-17 21:59:01 +00:00
{% set description = change.change_log %}
2018-07-06 01:28:06 +00:00
2019-04-11 22:31:23 +00:00
{% if change.change_action == constant('MSZ_CHANGELOG_ACTION_ADD') %}
{% set action_name = 'Added' %}
{% elseif change.change_action == constant('MSZ_CHANGELOG_ACTION_REMOVE') %}
{% set action_name = 'Removed' %}
{% elseif change.change_action == constant('MSZ_CHANGELOG_ACTION_UPDATE') %}
{% set action_name = 'Updated' %}
{% elseif change.change_action == constant('MSZ_CHANGELOG_ACTION_FIX') %}
{% set action_name = 'Fixed' %}
{% elseif change.change_action == constant('MSZ_CHANGELOG_ACTION_IMPORT') %}
{% set action_name = 'Imported' %}
{% elseif change.change_action == constant('MSZ_CHANGELOG_ACTION_REVERT') %}
{% set action_name = 'Reverted' %}
{% else %}
{% set action_name = 'Unknown' %}
{% endif %}
2018-07-06 01:28:06 +00:00
{% block content %}
2019-04-11 22:31:23 +00:00
<div class="container changelog__log changelog__action--{{ changelog_action_name(change.change_action) }}">
<div class="changelog__log__action">
{{ action_name }}
2018-11-17 21:59:01 +00:00
</div>
2018-10-22 19:53:21 +00:00
2019-03-02 21:04:45 +00:00
<div class="changelog__log__text">
{{ change.change_log }}
2018-11-17 21:59:01 +00:00
</div>
</div>
<div class="container changelog__change" style="{% if change.user_colour is not null %}{{ change.user_colour|html_colour('--accent-colour') }}{% endif %}">
<div class="changelog__change__info">
<div class="changelog__change__info__background"></div>
<div class="changelog__change__info__content">
{% if change.user_id is not null %}
<div class="changelog__change__user">
2019-09-28 19:21:23 +00:00
<a class="changelog__change__avatar" href="{{ url('user-profile', {'user': change.user_id}) }}">
{{ avatar(change.user_id, 60, change.username) }}
2018-11-17 21:59:01 +00:00
</a>
2018-07-06 01:28:06 +00:00
2018-11-17 21:59:01 +00:00
<div class="changelog__change__user__details">
2019-01-24 20:54:24 +00:00
<a class="changelog__change__username" href="{{ url('user-profile', {'user': change.user_id}) }}">{{ change.username }}</a>
<a class="changelog__change__userrole" href="{{ url('user-list', {'role': change.user_role}) }}">{{ change.user_title }}</a>
2018-07-06 01:28:06 +00:00
</div>
</div>
2018-11-17 21:59:01 +00:00
{% endif %}
2018-07-06 01:28:06 +00:00
2019-01-24 20:54:24 +00:00
<a class="changelog__change__date" href="{{ url('changelog-date', {'date': change.change_date}) }}">
2018-11-17 21:59:01 +00:00
Created
<time datetime="{{ change.change_created|date('c') }}" title="{{ change.change_created|date('r') }}">
{{ change.change_created|time_diff }}
</time>
</a>
2018-07-06 01:28:06 +00:00
2018-11-17 21:59:01 +00:00
{% if tags|length > 0 %}
<ul class="changelog__change__tags">
{% for tag in tags %}
<li class="changelog__change__tag" title="{{ tag.tag_description }}">
2019-01-24 20:54:24 +00:00
<a href="{{ url('changelog-tag', {'tag': tag.tag_id}) }}" class="changelog__change__tag__link">
2018-11-17 21:59:01 +00:00
{{ tag.tag_name }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
2018-07-06 01:28:06 +00:00
2018-11-17 21:59:01 +00:00
<div class="changelog__change__text markdown">
<h1>{{ title }}</h1>
2018-07-06 01:28:06 +00:00
2018-11-17 21:59:01 +00:00
{% if change.change_text|length >= 1 %}
{{ change.change_text|parse_text(constant('MSZ_PARSER_MARKDOWN'))|raw }}
2018-07-06 01:28:06 +00:00
{% else %}
2018-11-17 21:59:01 +00:00
<p>This change has no additional notes.</p>
2018-07-06 01:28:06 +00:00
{% endif %}
</div>
</div>
2018-08-06 22:19:35 +00:00
{% if comments is defined %}
<div class="container">
{{ container_title('<i class="fas fa-comments fa-fw"></i> Comments for ' ~ change.change_date) }}
2018-08-06 22:19:35 +00:00
{{ comments_section(comments, comments_category, current_user|default(null), comments_perms) }}
</div>
{% endif %}
2018-07-06 01:28:06 +00:00
{% endblock %}