1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #2511: Compare object change to the previous change

This commit is contained in:
Saria Hajjar
2020-02-15 22:39:08 +00:00
parent 1a8eea5aa9
commit faa22cb637
3 changed files with 69 additions and 0 deletions

View File

@@ -83,6 +83,35 @@
</tr>
</table>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Difference</strong>
<div class="btn-group btn-group-xs pull-right noprint">
<a {% if prev_change %}href="{% url 'extras:objectchange' pk=prev_change.pk %}"{% else %}disabled{% endif %} class="btn btn-default">
<span class="fa fa-chevron-left" aria-hidden="true"></span> Previous
</a>
<a {% if next_change %}href="{% url 'extras:objectchange' pk=next_change.pk %}"{% else %}disabled{% endif %} class="btn btn-default">
Next <span class="fa fa-chevron-right" aria-hidden="true"></span>
</a>
</div>
</div>
<div class="panel-body">
{% if diff_added == diff_removed %}
<span class="text-muted" style="margin-left: 10px;">
{% if objectchange.action == 'create' %}
Object created
{% elif objectchange.action == 'delete' %}
Object deleted
{% else %}
No changes
{% endif %}
</span>
{% else %}
<pre style="background-color: #ffdce0;">{{ diff_removed|render_json }}</pre>
<pre style="background-color: #cdffd8;">{{ diff_added|render_json }}</pre>
{% endif %}
</div>
</div>
</div>
<div class="col-md-7">
<div class="panel panel-default">