2018-07-06 01:28:06 +00:00
|
|
|
{% macro changelog_listing(changes, hide_dates) %}
|
|
|
|
{% set hide_dates = hide_dates ? true : false %}
|
|
|
|
{% set last_date = '' %}
|
|
|
|
|
|
|
|
{% 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-07-11 21:48:41 +00:00
|
|
|
<a class="changelog__date" href="/changelog.php?d={{ last_date }}">
|
2018-07-06 01:28:06 +00:00
|
|
|
{{ last_date }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{{ changelog_entry(change) }}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<div class="changelog__none">
|
|
|
|
There are no changes to display here.
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro changelog_entry(change) %}
|
|
|
|
{% 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 }}">
|
|
|
|
<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 }}"
|
2018-07-11 21:48:41 +00:00
|
|
|
href="/changelog.php?c={{ change.change_id }}"
|
2018-07-06 01:28:06 +00:00
|
|
|
{% if change.action_colour is defined %}style="{{ change.action_colour|html_colour({'background-color':'%s'}) }}"{% endif %}>
|
2018-07-07 14:57:10 +00:00
|
|
|
<div class="changelog__action__text">
|
|
|
|
{{ change.action_name|default('Unknown') }}
|
|
|
|
</div>
|
2018-07-06 01:28:06 +00:00
|
|
|
</a>
|
|
|
|
|
2018-07-11 21:48:41 +00:00
|
|
|
{% if change.user_id is defined %}
|
|
|
|
<a class="changelog__user"
|
|
|
|
href="/profile.php?u={{ change.user_id }}"
|
|
|
|
style="{{ change.user_colour|html_colour }}">
|
|
|
|
<div class="changelog__user__text">
|
|
|
|
{{ change.username }}
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-07-06 01:28:06 +00:00
|
|
|
|
|
|
|
<a class="changelog__log{% if has_text %} changelog__log--link{% endif %}"
|
2018-07-11 21:48:41 +00:00
|
|
|
{% if has_text %}href="/changelog.php?c={{ change.change_id }}"{% endif %}>
|
2018-07-06 01:28:06 +00:00
|
|
|
{{ change.change_log }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|