{% load i18n static %} {# Floating trigger button — fixed bottom-right #} {# Modal #}
{# Header #}
history

{% trans "Change history" %}

{{ history_notifications|length }} {% trans "records" %}
{# Scrollable list #}
{% for notif in history_notifications %}
{# Avatar #}
{% if notif.action_by %} {% if notif.action_by.avatar %} {% else %} {% if notif.action_by.is_bot %}smart_toy{% else %}person{% endif %} {% endif %} {% else %} person {% endif %}
{# Content #}
{# Action badge #} {% if notif.action == 'create' %}add_circle {% elif notif.action == 'delete' %}delete {% elif notif.action == 'restore' %}restore {% else %}edit{% endif %} {% if notif.action == 'create' %}{% trans "Create" %}{% elif notif.action == 'delete' %}{% trans "Delete" %}{% elif notif.action == 'restore' %}{% trans "Restore" %}{% else %}{% trans "Update" %}{% endif %} {# Actor #} {% if notif.action_by %} {{ notif.action_by }} {% endif %} {# Timestamp #} {{ notif.created_at|date:"d/m/Y H:i" }}
{# Changed fields — old → new diff #} {% if notif.parsed_changed_data %}
{% for change in notif.parsed_changed_data %}
{{ change.field_name }}
{% if change.old_value %}{{ change.old_value }}{% else %}—{% endif %} arrow_forward {% if change.new_value %}{{ change.new_value }}{% else %}—{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{# Click backdrop to close #}