1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/templates/extras/configrevision_restore.html
Arthur Hanson 148278a74a 12591 config params admin (#12904)
* 12591 initial commit

* 12591 detail view

* 12591 add/edit view

* 12591 edit button

* 12591 base views and forms

* 12591 form cleanup

* 12591 form cleanup

* 12591 form cleanup

* 12591 review changes

* 12591 move check for restrictedqueryset

* 12591 restore view

* 12591 restore page styling

* 12591 remove admin

* Remove edit view for ConfigRevision instances

* Order ConfigRevisions by creation time

* Correct permission name

* Use RestrictedQuerySet for ConfigRevision

* Fix redirect URL

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-06-22 14:04:24 -04:00

89 lines
2.5 KiB
HTML

{% extends 'base/layout.html' %}
{% load helpers %}
{% load buttons %}
{% load perms %}
{% load static %}
{% block title %}Restore: {{ object }}{% endblock %}
{% block subtitle %}
<div class="object-subtitle">
<span>Created {{ object.created|annotated_date }}</span>
</div>
{% endblock %}
{% block header %}
<div class="row noprint">
<div class="col col-md-12">
<nav class="breadcrumb-container px-3" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'extras:configrevision_list' %}">Config revisions</a></li>
<li class="breadcrumb-item"><a href="{% url 'extras:configrevision' pk=object.pk %}">{{ object }}</a></li>
</ol>
</nav>
</div>
</div>
{{ block.super }}
{% endblock header %}
{% block controls %}
<div class="controls">
<div class="control-group">
{% if request.user|can_delete:job %}
{% delete_button job %}
{% endif %}
</div>
</div>
{% endblock controls %}
{% block tabs %}
<ul class="nav nav-tabs px-3" role="tablist">
<li class="nav-item" role="presentation">
<a href="#log" role="tab" data-bs-toggle="tab" class="nav-link active">Restore</a>
</li>
</ul>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<table class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Current Value</th>
<th scope="col">New Value</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{% for param, current, new in params %}
<tr{% if current != new %} class="table-warning"{% endif %}>
<td>{{ param }}</td>
<td>{{ current }}</td>
<td>{{ new }}</td>
<td>{% if current != new %}<img src="{% static 'admin/img/icon-changelink.svg' %}" alt="*" title="Changed">{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<form method="post">
{% csrf_token %}
<div class="submit-row" style="margin-top: 20px">
<div class="controls">
<div class="control-group">
<button type="submit" name="restore" class="btn btn-primary">Restore</button>
<a href="{% url 'extras:configrevision_list' %}" id="cancel" name="cancel" class="btn btn-outline-danger">Cancel</a>
</div>
</div>
</div>
</form>
{% endblock content %}
{% block modals %}
{% endblock modals %}