mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-09 21:32:17 -06:00
Implemented changelog views
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
{% extends base_template %}
|
||||
|
||||
{% block title %}{% if obj %}{{ obj }}{% else %}{{ block.super }}{% endif %} - Changelog{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if obj %}<h1>{{ obj }}</h1>{% endif %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>User</th>
|
||||
<th>Action</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for change in changes %}
|
||||
<tr>
|
||||
<td>{{ change.time }}</td>
|
||||
<td>{{ change.user }}</td>
|
||||
<td>{{ change.get_action_display }}</td>
|
||||
<td>
|
||||
<button class="btn btn-xs btn-primary" type="button" data-toggle="collapse" data-target="#change{{ change.pk }}" aria-expanded="false" aria-controls="collapseExample">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="collapse" id="change{{ change.pk }}">
|
||||
<td colspan="4">
|
||||
<pre class="well">{{ change.object_data_pretty }}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
8
netbox/templates/extras/object_changelog.html
Normal file
8
netbox/templates/extras/object_changelog.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends base_template %}
|
||||
|
||||
{% block title %}{% if obj %}{{ obj }}{% else %}{{ block.super }}{% endif %} - Changelog{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if obj %}<h1>{{ obj }}</h1>{% endif %}
|
||||
{% include 'panel_table.html' with table=objectchanges_table %}
|
||||
{% endblock %}
|
||||
101
netbox/templates/extras/objectchange.html
Normal file
101
netbox/templates/extras/objectchange.html
Normal file
@@ -0,0 +1,101 @@
|
||||
{% extends '_base.html' %}
|
||||
{% load helpers %}
|
||||
|
||||
{% block title %}{{ objectchange }}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="row">
|
||||
<div class="col-sm-8 col-md-9">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{% url 'extras:objectchange_list' %}">Changelog</a></li>
|
||||
<li>{{ objectchange }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="col-sm-4 col-md-3">
|
||||
<form action="{% url 'extras:objectchange_list' %}" method="get">
|
||||
<div class="input-group">
|
||||
<input type="text" name="q" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="fa fa-search" aria-hidden="true"></span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Change</strong>
|
||||
</div>
|
||||
<table class="table table-hover panel-body attr-table">
|
||||
<tr>
|
||||
<td>Time</td>
|
||||
<td>
|
||||
{{ objectchange.time }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User</td>
|
||||
<td>
|
||||
{{ objectchange.user|default:objectchange.user_name }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Action</td>
|
||||
<td>
|
||||
{{ objectchange.get_action_display }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Content Type</td>
|
||||
<td>
|
||||
{{ objectchange.content_type }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Object</td>
|
||||
<td>
|
||||
{% if objectchange.changed_object.get_absolute_url %}
|
||||
<a href="{{ objectchange.changed_object.get_aboslute_url }}">{{ objectchange.changed_object }}</a>
|
||||
{% else %}
|
||||
{{ objectchange.object_repr }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Request ID</td>
|
||||
<td>
|
||||
{{ objectchange.request_id }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Object Data</strong>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<pre>{{ objectchange.object_data_pretty }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{% include 'panel_table.html' with table=related_changes_table heading='Related Changes' %}
|
||||
{% if related_changes_count > related_changes_table.rows|length %}
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'extras:objectchange_list' %}?request_id={{ objectchange.request_id }}" class="btn btn-primary">See all {{ related_changes_count|add:"1" }} changes</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
netbox/templates/extras/objectchange_list.html
Normal file
17
netbox/templates/extras/objectchange_list.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends '_base.html' %}
|
||||
{% load buttons %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pull-right">
|
||||
{% export_button content_type %}
|
||||
</div>
|
||||
<h1>{% block title %}Changelog{% endblock %}</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{% include 'utilities/obj_table.html' %}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{% include 'inc/search_panel.html' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user