{% macro applied_change_template(hist_rec_entry) -%} {{ caller() }} {% if hist_rec_entry.change_type == '-' %}
{{ hist_rec_entry.del_rrset['name'] }} {% elif hist_rec_entry.change_type == '+' %}
{{ hist_rec_entry.add_rrset['name'] }} {% else %}
{{ hist_rec_entry.add_rrset['name'] }} {% endif %}
{% if hist_rec_entry.change_type == '-' %}
{{ hist_rec_entry.del_rrset['type'] }} {% elif hist_rec_entry.change_type == '+' %}
{{ hist_rec_entry.add_rrset['type'] }} {% else %}
{{ hist_rec_entry.add_rrset['type'] }} {% endif %}
{% if not 'ttl' in hist_rec_entry.changed_fields %}
{{ hist_rec_entry.add_rrset['ttl'] }}
{% else %} {% if hist_rec_entry.change_type in ['+', '*'] %}
{{ hist_rec_entry.add_rrset['ttl'] }}
{% endif %} {% if hist_rec_entry.change_type in ['-', '*'] %}
{{ hist_rec_entry.del_rrset['ttl'] }}
{% endif %} {% endif %} {% for changes in hist_rec_entry.changeSet %} {% if changes[2] == "unchanged" or (changes[2] == "edit" and changes[0]['content'] == changes[1]['content']) %}
{{ changes[1]['content'] }}
{% else %} {% if changes[2] in ["deletion", "edit"] %}
{{ changes[0]['content'] }}
{% endif %} {% if changes[2] in ["addition", "edit"] %}
{{ changes[1]['content'] }}
{% endif %} {% endif %} {% endfor %} {% for changes in hist_rec_entry.changeSet %} {% if changes[2] == "unchanged" or (changes[2] == "edit" and changes[0]['disabled'] == changes[1]['disabled']) %}
{{ "Disabled" if changes[1]['disabled'] else "Activated" }}
{% else %} {% if changes[2] in ["deletion", "edit"] %}
{{ "Disabled" if changes[0]['disabled'] else "Activated" }}
{% endif %} {% if changes[2] in ["addition", "edit"] %}
{{ "Disabled" if changes[1]['disabled'] else "Activated" }}
{% endif %} {% endif %} {% endfor %} {% for changes in hist_rec_entry.changeSet %} {% if changes[2] == "unchanged" or (changes[2] == "edit" and changes[0]['comment'] == changes[1]['comment']) %}
{{ changes[1]['comment'] }}
{% else %} {% if changes[2] in ["deletion", "edit"] and changes[0]['comment'] %}
{{ changes[0]['comment'] }}
{% endif %} {% if changes[2] in ["addition", "edit"] and changes[1]['comment'] %}
{{ changes[1]['comment'] }}
{% endif %} {% endif %} {% endfor %} {%- endmacro %}