{% extends 'generic/object.html' %} {% load static %} {% block head %} {{ block.super }} {% endblock head %} {% block content %}
{% if error %}
{{ error }}
{% endif %} {# Commit picker #}
Base Compare {% if sha_old and sha_new and diff_data %} Download .patch {% endif %}
{% if diff_data %}
Config History{{ diff_data.old_sha|slice:":7"|default:"(new file)" }}{{ diff_data.new_sha|slice:":7" }}
{# Inline diff #}
{% for hunk in diff_data.hunks %}
@@ -{{ hunk.old_start }},{{ hunk.old_lines }} +{{ hunk.new_start }},{{ hunk.new_lines }} @@
{% for marker, content in hunk.lines %} {% if marker == '+' %}
+{{ content }}
{% elif marker == '-' %}
-{{ content }}
{% else %}
{{ content }}
{% endif %} {% endfor %} {% empty %}
No changes found between these commits.
{% endfor %}
{# Side-by-side diff #}
{% elif not error %}
Select two commits above to compare.
{% endif %} {# Change notes — stored in NetBox, attached to the "new" commit #} {% if sha_new %}
Change notes for {{ sha_new|slice:":7" }}
{% for note in notes %}
{{ note.message }}
{{ note.created_by|default:"—" }}
{{ note.created|date:"Y-m-d H:i" }}
{% empty %}

No notes on this change yet.

{% endfor %} {% if can_add_note %}
{% csrf_token %}
{% endif %}
{% endif %}
{% endblock content %} {% block javascript %} {{ block.super }} {% endblock javascript %}