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

Merge branch 'develop' into develop-2.3

This commit is contained in:
Jeremy Stretch
2018-01-31 11:13:17 -05:00
25 changed files with 275 additions and 50 deletions

View File

@@ -64,13 +64,14 @@
{% endfor %}
</tbody>
</table>
{% if perms.dcim.add_inventoryitem %}
<div class="panel-footer text-right">
<a href="{% url 'dcim:inventoryitem_add' device=device.pk %}" class="btn btn-primary btn-xs">
<span class="fa fa-plus" aria-hidden="true"></span> Add Inventory Item
</a>
</div>
{% endif %}
</div>
{% if perms.dcim.add_inventoryitem %}
<a href="{% url 'dcim:inventoryitem_add' device=device.pk %}" class="btn btn-success">
<span class="fa fa-plus" aria-hidden="true"></span>
Add Inventory Item
</a>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -11,7 +11,7 @@
<a href="{% url 'dcim:inventoryitem_edit' pk=item.pk %}" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
{% endif %}
{% if perms.dcim.delete_inventoryitem %}
<a href="{% url 'dcim:inventoryitem_delete' pk=item.pk %}?return_url={% url 'dcim:device_inventory' pk=device.pk %}" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
<a href="{% url 'dcim:inventoryitem_delete' pk=item.pk %}" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
{% endif %}
</td>
</tr>

View File

@@ -0,0 +1,5 @@
{% extends 'utilities/obj_bulk_delete.html' %}
{% block message_extra %}
<p class="text-center text-danger"><i class="fa fa-warning"></i> This will also delete all child inventory items of those listed.</p>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends '_base.html' %}
{% load helpers %}
{% block content %}
<div class="pull-right">
{% if perms.dcim.add_devicetype %}
<a href="{% url 'dcim:inventoryitem_import' %}" class="btn btn-info">
<span class="fa fa-download" aria-hidden="true"></span>
Import inventory items
</a>
{% endif %}
{% include 'inc/export_button.html' with obj_type='inventory items' %}
</div>
<h1>{% block title %}Inventory Items{% endblock %}</h1>
<div class="row">
<div class="col-md-9">
{% include 'utilities/obj_table.html' with bulk_edit_url='dcim:inventoryitem_bulk_edit' bulk_delete_url='dcim:inventoryitem_bulk_delete' %}
</div>
<div class="col-md-3">
{% include 'inc/search_panel.html' %}
</div>
</div>
{% endblock %}

View File

@@ -17,8 +17,11 @@
</div>
<h1>{% block title %}Regions{% endblock %}</h1>
<div class="row">
<div class="col-md-12">
<div class="col-md-9">
{% include 'utilities/obj_table.html' with bulk_delete_url='dcim:region_bulk_delete' %}
</div>
<div class="col-md-3">
{% include 'inc/search_panel.html' %}
</div>
</div>
{% endblock %}

View File

@@ -1,6 +1,6 @@
{% if report.result.failed %}
{% if result.failed %}
<label class="label label-danger">Failed</label>
{% elif report.result %}
{% elif result %}
<label class="label label-success">Passed</label>
{% else %}
<label class="label label-default">N/A</label>

View File

@@ -22,7 +22,7 @@
</form>
</div>
{% endif %}
<h1>{{ report.name }}{% include 'extras/inc/report_label.html' %}</h1>
<h1>{{ report.name }}{% include 'extras/inc/report_label.html' with result=report.result %}</h1>
<div class="row">
<div class="col-md-12">
{% if report.description %}

View File

@@ -24,7 +24,7 @@
<a href="{% url 'extras:report' name=report.full_name %}" name="report.{{ report.name }}"><strong>{{ report.name }}</strong></a>
</td>
<td>
{% include 'extras/inc/report_label.html' %}
{% include 'extras/inc/report_label.html' with result=report.result %}
</td>
<td>{{ report.description|default:"" }}</td>
{% if report.result %}

View File

@@ -150,6 +150,21 @@
</div>
{% endif %}
</div>
{% if report_results %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Reports</strong>
</div>
<table class="table table-hover panel-body">
{% for result in report_results %}
<span>
<td><a href="{% url 'extras:report' name=result.report %}">{{ result.report }}</a></td>
<td class="text-right"><span title="{{ result.created }}">{% include 'extras/inc/report_label.html' %}</span></td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Recent Activity</strong>

View File

@@ -104,7 +104,7 @@
</li>
</ul>
</li>
<li class="dropdown{% if request.path|contains:'/dcim/device,/dcim/manufacturers/,/dcim/platforms/,-connections/' %} active{% endif %}">
<li class="dropdown{% if request.path|contains:'/dcim/device,/dcim/manufacturers/,/dcim/platforms/,-connections/,/dcim/inventory-items/' %} active{% endif %}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Devices <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Devices</li>
@@ -156,6 +156,16 @@
<a href="{% url 'dcim:manufacturer_list' %}">Manufacturers</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">Inventory</li>
<li>
{% if perms.dcim.add_inventoryitem %}
<div class="buttons pull-right">
<a href="{% url 'dcim:inventoryitem_import' %}" class="btn btn-xs btn-info" title="Import"><i class="fa fa-download"></i></a>
</div>
{% endif %}
<a href="{% url 'dcim:inventoryitem_list' %}">Inventory Items</a>
</li>
<li class="divider"></li>
<li class="dropdown-header">Connections</li>
<li>
{% if perms.dcim.change_consoleport %}

View File

@@ -9,7 +9,8 @@
<div class="panel panel-danger">
<div class="panel-heading"><strong>Confirm Bulk Deletion</strong></div>
<div class="panel-body">
<strong>Warning:</strong> The following operation will delete {{ table.rows|length }} {{ obj_type_plural }}. Please carefully review the {{ obj_type_plural }} to be deleted and confirm below.
<p><strong>Warning:</strong> The following operation will delete {{ table.rows|length }} {{ obj_type_plural }}. Please carefully review the {{ obj_type_plural }} to be deleted and confirm below.</p>
{% block message_extra %}{% endblock %}
</div>
</div>
</div>