2021-11-30 09:02:37 +00:00
|
|
|
{% macro applied_change_template(change_set) -%}
|
|
|
|
{{ caller() }}
|
|
|
|
{% for hist_rec_entry in change_set %}
|
|
|
|
<table id="tbl_records" class="table table-bordered">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-03-03 12:22:29 +00:00
|
|
|
<th scope="col" colspan="3">
|
|
|
|
{% if hist_rec_entry.change_type == '-' %}
|
|
|
|
<span class="diff diff-deletion">{{
|
|
|
|
hist_rec_entry.del_rrset['name'] }} {{ hist_rec_entry.del_rrset['type']
|
|
|
|
}}</span>
|
|
|
|
{% elif hist_rec_entry.change_type == '+' %}
|
|
|
|
<span class="diff diff-addition">{{
|
|
|
|
hist_rec_entry.add_rrset['name'] }} {{ hist_rec_entry.add_rrset['type']
|
|
|
|
}}</span>
|
2021-11-30 09:02:37 +00:00
|
|
|
{% else %}
|
2023-03-03 12:22:29 +00:00
|
|
|
<span class="diff diff-unchanged">{{
|
|
|
|
hist_rec_entry.add_rrset['name'] }} {{ hist_rec_entry.add_rrset['type']
|
|
|
|
}}</span>
|
2021-11-30 09:02:37 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2023-03-03 12:22:29 +00:00
|
|
|
, TTL
|
|
|
|
{% if not 'ttl' in hist_rec_entry.changed_fields %}
|
|
|
|
<span class="diff diff-unchanged">{{
|
|
|
|
hist_rec_entry.add_rrset['ttl']
|
|
|
|
}}</span>
|
2021-11-30 09:02:37 +00:00
|
|
|
{% else %}
|
2023-03-03 12:22:29 +00:00
|
|
|
{% if hist_rec_entry.change_type in ['-', '*'] %}
|
|
|
|
<span class="diff diff-deletion">{{
|
|
|
|
hist_rec_entry.del_rrset['ttl']
|
|
|
|
}}</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if hist_rec_entry.change_type in ['+', '*'] %}
|
|
|
|
<span class="diff diff-addition">{{
|
|
|
|
hist_rec_entry.add_rrset['ttl']
|
|
|
|
}}</span>
|
|
|
|
{% endif %}
|
2021-11-30 09:02:37 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
|
2023-03-03 12:22:29 +00:00
|
|
|
<tr>
|
|
|
|
<th scope="col" style="width: 150px;">Status</th>
|
|
|
|
<th scope="col" style="width: 400px;">Data</th>
|
|
|
|
<th scope="col" style="width: 400px;">Comment</th>
|
2021-11-30 09:02:37 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2023-03-03 12:22:29 +00:00
|
|
|
{% for changes in hist_rec_entry.changeSet %}
|
2021-11-30 09:02:37 +00:00
|
|
|
<tr>
|
2023-03-03 12:22:29 +00:00
|
|
|
<td style="word-break: break-all">
|
|
|
|
{% if changes[2] == "unchanged" or
|
|
|
|
(changes[2] == "edit" and changes[0]['disabled'] == changes[1]['disabled']) %}
|
|
|
|
<div class="diff diff-unchanged">{{
|
|
|
|
"Disabled" if changes[1]['disabled'] else "Activated"
|
|
|
|
}}</div>
|
|
|
|
{% else %}
|
|
|
|
{% if changes[2] in ["deletion", "edit"] %}
|
|
|
|
<div class="diff diff-deletion">{{
|
|
|
|
"Disabled" if changes[0]['disabled'] else "Activated"
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if changes[2] in ["addition", "edit"] %}
|
|
|
|
<div class="diff diff-addition">{{
|
|
|
|
"Disabled" if changes[1]['disabled'] else "Activated"
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2021-11-30 09:02:37 +00:00
|
|
|
</td>
|
2023-03-03 12:22:29 +00:00
|
|
|
<td style="word-break: break-all">
|
|
|
|
{% if changes[2] == "unchanged" or
|
|
|
|
(changes[2] == "edit" and changes[0]['content'] == changes[1]['content']) %}
|
|
|
|
<div class="diff diff-unchanged">{{
|
|
|
|
changes[1]['content']
|
|
|
|
}}</div>
|
|
|
|
{% else %}
|
|
|
|
{% if changes[2] in ["deletion", "edit"] %}
|
|
|
|
<div class="diff diff-deletion">{{
|
|
|
|
changes[0]['content']
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if changes[2] in ["addition", "edit"] %}
|
|
|
|
<div class="diff diff-addition">{{
|
|
|
|
changes[1]['content']
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2021-11-30 09:02:37 +00:00
|
|
|
</td>
|
2023-01-13 09:05:20 +00:00
|
|
|
<td style="word-break: break-all">
|
2023-03-03 12:22:29 +00:00
|
|
|
{% if changes[2] == "unchanged" or
|
|
|
|
(changes[2] == "edit" and changes[0]['comment'] == changes[1]['comment']) %}
|
|
|
|
<div class="diff diff-unchanged">{{
|
|
|
|
changes[1]['comment']
|
|
|
|
}}</div>
|
|
|
|
{% else %}
|
|
|
|
{% if changes[2] in ["deletion", "edit"] and changes[0]['comment'] %}
|
|
|
|
<div class="diff diff-deletion">{{
|
|
|
|
changes[0]['comment']
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if changes[2] in ["addition", "edit"] and changes[1]['comment'] %}
|
|
|
|
<div class="diff diff-addition">{{
|
|
|
|
changes[1]['comment']
|
|
|
|
}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2021-11-30 09:02:37 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2023-03-03 12:22:29 +00:00
|
|
|
{% endfor %}
|
2021-11-30 09:02:37 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% endfor %}
|
2022-05-18 22:53:35 +00:00
|
|
|
{%- endmacro %}
|