mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
bootstrap 5 template updates
This commit is contained in:
@ -5,60 +5,64 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-default">
|
<div class="card">
|
||||||
<div class="panel-heading">
|
<h5 class="card-header">
|
||||||
<strong>Device Bay</strong>
|
Device Bay
|
||||||
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-hover attr-table">
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Device</th>
|
||||||
|
<td>
|
||||||
|
<a href="{{ object.device.get_absolute_url }}">{{ object.device }}</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Name</th>
|
||||||
|
<td>{{ object.name }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Label</th>
|
||||||
|
<td>{{ object.label|placeholder }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Description</th>
|
||||||
|
<td>{{ object.description|placeholder }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-hover panel-body attr-table">
|
|
||||||
<tr>
|
|
||||||
<td>Device</td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ object.device.get_absolute_url }}">{{ object.device }}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Name</td>
|
|
||||||
<td>{{ object.name }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Label</td>
|
|
||||||
<td>{{ object.label|placeholder }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Description</td>
|
|
||||||
<td>{{ object.description|placeholder }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
{% include 'inc/custom_fields_panel.html' %}
|
{% include 'inc/custom_fields_panel.html' %}
|
||||||
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all %}
|
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all %}
|
||||||
{% plugin_left_page object %}
|
{% plugin_left_page object %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-default">
|
<div class="card">
|
||||||
<div class="panel-heading">
|
<h5 class="card-header">
|
||||||
<strong>Installed Device</strong>
|
Installed Device
|
||||||
</div>
|
</h5>
|
||||||
|
<div class="card-body">
|
||||||
{% if object.installed_device %}
|
{% if object.installed_device %}
|
||||||
{% with device=object.installed_device %}
|
{% with device=object.installed_device %}
|
||||||
<table class="table table-hover panel-body attr-table">
|
<table class="table table-hover attr-table">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Device</td>
|
<th scope="row">Device</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ device.get_absolute_url }}">{{ device }}</a>
|
<a href="{{ device.get_absolute_url }}">{{ device }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Device Type</td>
|
<th scope="row">Device Type</th>
|
||||||
<td>{{ device.device_type }}</td>
|
<td>{{ device.device_type }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="panel-body text-muted">
|
<div class="text-muted">
|
||||||
None
|
None
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% plugin_right_page object %}
|
{% plugin_right_page object %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,41 +1,31 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load form_helpers %}
|
{% load form_helpers %}
|
||||||
|
|
||||||
|
{% render_errors form %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form action="." method="post" class="form form-horizontal">
|
<form action="." method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<div class="col-md-6 col-md-offset-3">
|
||||||
{% if form.non_field_errors %}
|
<div class="card">
|
||||||
<div class="panel panel-danger">
|
<div class="card-header">{% block title %}Populate {{ device_bay }}{% endblock %}</div>
|
||||||
<div class="panel-heading"><strong>Errors</strong></div>
|
<div class="card-body">
|
||||||
<div class="panel-body">
|
<div class="form-floating mb-3">
|
||||||
{{ form.non_field_errors }}
|
<input class="form-control" value="{{ device_bay.device }}" disabled />
|
||||||
|
<label>Parent Device</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-floating mb-3">
|
||||||
{% endif %}
|
<input class="form-control" value="{{ device_bay }}" disabled />
|
||||||
<div class="panel panel-default">
|
<label>Bay</label>
|
||||||
<div class="panel-heading">{% block title %}Populate {{ device_bay }}{% endblock %}</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-md-3 control-label required">Parent Device</label>
|
|
||||||
<div class="col-md-9">
|
|
||||||
<p class="form-control-static">{{ device_bay.device }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-md-3 control-label required">Bay</label>
|
|
||||||
<div class="col-md-9">
|
|
||||||
<p class="form-control-static">{{ device_bay }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% render_form form %}
|
{% render_form form %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
|
<a href="{{ return_url }}" class="btn btn-outline-dark">Cancel</a>
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Save</button>
|
<button type="submit" name="_update" class="btn btn-primary">Save</button>
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,39 +3,26 @@
|
|||||||
|
|
||||||
{% block title %}Add {{ component_type }} to {{ parent }}{% endblock %}
|
{% block title %}Add {{ component_type }} to {{ parent }}{% endblock %}
|
||||||
|
|
||||||
|
{% render_errors form %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form action="." method="post" class="form form-horizontal">
|
<form action="." method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<div class="col-md-6 col-md-offset-3">
|
||||||
{% if form.non_field_errors %}
|
<div class="field-group mb-3">
|
||||||
<div class="panel panel-danger">
|
<h4>New {{ component_type }}</h4>
|
||||||
<div class="panel-heading"><strong>Errors</strong></div>
|
<div class="form-floating mb-3">
|
||||||
<div class="panel-body">
|
<input class="form-control" value="{{ parent }}" disabled />
|
||||||
{{ form.non_field_errors }}
|
<label>Device Type</label>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<strong>New {{ component_type }}</strong>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-md-3 control-label required">Device Type</label>
|
|
||||||
<div class="col-md-9">
|
|
||||||
<p class="form-control-static">{{ parent }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% render_form form %}
|
{% render_form form %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<a href="{{ return_url }}" class="btn btn-outline-danger">Cancel</a>
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Save</button>
|
<button type="submit" name="_update" class="btn btn-primary">Save</button>
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
Reference in New Issue
Block a user