2018-08-16 17:26:16 +00:00
|
|
|
{% macro changelog_listing(changes, hide_dates, is_manage, change_url, date_url, tag_url, user_url) %}
|
2018-07-06 01:28:06 +00:00
|
|
|
{% set hide_dates = hide_dates ? true : false %}
|
2018-08-16 17:26:16 +00:00
|
|
|
{% set is_manage = is_manage ? true : false %}
|
2018-07-06 01:28:06 +00:00
|
|
|
{% set last_date = '' %}
|
2018-08-16 17:26:16 +00:00
|
|
|
{% set date_url = date_url|default('/changelog.php?d=%s') %}
|
2018-07-06 01:28:06 +00:00
|
|
|
|
|
|
|
{% from _self import changelog_entry %}
|
|
|
|
|
|
|
|
{% if changes|length > 0 %}
|
|
|
|
{% for change in changes %}
|
|
|
|
{% if not hide_dates and last_date != change.change_date %}
|
|
|
|
{% set last_date = change.change_date %}
|
|
|
|
|
2018-08-16 17:26:16 +00:00
|
|
|
<a class="changelog__date" href="{{ date_url|format(last_date) }}"
|
|
|
|
{% if date_url|slice(0, 1) == '#' %} id="{{ date_url|format(last_date)|slice(1) }}"{% endif %}>
|
2018-07-06 01:28:06 +00:00
|
|
|
{{ last_date }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2018-08-16 17:26:16 +00:00
|
|
|
{{ changelog_entry(change, is_manage, change_url, tag_url, user_url) }}
|
2018-07-06 01:28:06 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<div class="changelog__none">
|
|
|
|
There are no changes to display here.
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-08-16 17:26:16 +00:00
|
|
|
{% macro changelog_entry(change, is_manage, change_url, tag_url, user_url) %}
|
|
|
|
{% set is_manage = is_manage ? true : false %}
|
|
|
|
{% set change_url = change_url|default('/changelog.php?c=%d') %}
|
|
|
|
{% set tag_url = tag_url|default('/changelog.php?t=%d') %}
|
|
|
|
{% set user_url = user_url|default('/profile.php?u=%d') %}
|
2018-07-06 01:28:06 +00:00
|
|
|
{% set has_text = change.change_has_text|default(false)
|
|
|
|
or (change.change_text is defined and change.change_text|length > 0)
|
|
|
|
%}
|
|
|
|
|
|
|
|
<div class="changelog" id="cl{{ change.change_id }}">
|
2018-08-16 17:26:16 +00:00
|
|
|
<div class="changelog__info">
|
|
|
|
{% if is_manage %}
|
|
|
|
<a href="{{ change_url|format(change.change_id) }}" class="changelog__datetime">
|
|
|
|
<time class="changelog__datetime__text"
|
|
|
|
datetime="{{ change.change_created|date('c') }}"
|
|
|
|
title="{{ change.change_created|date('r') }}">
|
|
|
|
{{ change.change_created|time_diff }}
|
|
|
|
</time>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<a class="changelog__action{{ change.action_class is defined and change.action_class is not null ? ' changelog__action--' ~ change.action_class : '' }} changelog__action--{{ change.action_colour|colour_get_css_contrast }}"
|
|
|
|
href="{{ change_url|format(change.change_id) }}"
|
2018-09-23 14:42:15 +00:00
|
|
|
{% if change.action_colour is defined %}style="{{ change.action_colour|html_colour('--action-colour') }}"{% endif %}>
|
2018-08-16 17:26:16 +00:00
|
|
|
<div class="changelog__action__text">
|
|
|
|
{{ change.action_name|default('Unknown') }}
|
2018-07-11 21:48:41 +00:00
|
|
|
</div>
|
|
|
|
</a>
|
2018-07-06 01:28:06 +00:00
|
|
|
|
2018-08-16 17:26:16 +00:00
|
|
|
{% if change.user_id is defined %}
|
|
|
|
<a class="changelog__user"
|
|
|
|
href="{{ user_url|format(change.user_id) }}"
|
|
|
|
style="{{ change.user_colour|html_colour }}">
|
|
|
|
<div class="changelog__user__text">
|
|
|
|
{{ change.username }}
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="changelog__text">
|
|
|
|
<a class="changelog__log{% if has_text %} changelog__log--link{% endif %}"
|
|
|
|
{% if has_text %}href="{{ change_url|format(change.change_id) }}"{% endif %}>
|
|
|
|
{{ change.change_log }}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{% if is_manage %}
|
|
|
|
<div class="changelog__tags">
|
|
|
|
{% for tag in change.tags %}
|
|
|
|
<a href="{{ tag_url|format(tag.tag_id) }}" class="changelog__tag">
|
|
|
|
{{ tag.tag_name }}
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-07-06 01:28:06 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|