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

bootstrap 5 class updates

This commit is contained in:
checktheroads
2021-04-13 21:51:12 -07:00
parent 21d31b5747
commit d1d2ad6a5c
33 changed files with 611 additions and 530 deletions

View File

@@ -3,8 +3,8 @@
{% load plugins %}
{% block breadcrumbs %}
<li><a href="{% url 'ipam:routetarget_list' %}">Route Targets</a></li>
<li>{{ object }}</li>
<li class="breadcrumb-item"><a href="{% url 'ipam:routetarget_list' %}">Route Targets</a></li>
<li class="breadcrumb-item">{{ object }}</li>
{% endblock %}
{% block content %}

View File

@@ -15,23 +15,30 @@
<li class="breadcrumb-item">{{ object }}</li>
{% endblock %}
{% block tabs %}
<ul class="nav nav-tabs" style="margin-bottom: 20px">
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
<a href="{% url 'ipam:vlan' pk=object.pk %}">VLAN</a>
</li>
<li role="presentation"{% if active_tab == 'interfaces' %} class="active"{% endif %}>
<a href="{% url 'ipam:vlan_interfaces' pk=object.pk %}">Device Interfaces <span class="badge">{{ object.get_interfaces.count }}</span></a>
</li>
<li role="presentation"{% if active_tab == 'vminterfaces' %} class="active"{% endif %}>
<a href="{% url 'ipam:vlan_vminterfaces' pk=object.pk %}">VM Interfaces <span class="badge">{{ object.get_vminterfaces.count }}</span></a>
</li>
{% if perms.extras.view_objectchange %}
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
<a href="{% url 'ipam:vlan_changelog' pk=object.pk %}">Change Log</a>
</li>
{% endif %}
</ul>
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{% url 'ipam:vlan' pk=object.pk %}">VLAN</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'interfaces' %} active{% endif %}" href="{% url 'ipam:vlan_interfaces' pk=object.pk %}">
Device Interfaces
{% with count=object.get_interfaces.count %}
{% if count > 0 %}
<span class="badge bg-primary">{{ count }}</span>
{% endif %}
{% endwith %}
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link{% if active_tab == 'vminterfaces' %} active{% endif %}" href="{% url 'ipam:vlan_vminterfaces' pk=object.pk %}">
VM Interfaces
{% comment %} {% with count=object.get_vminterfaces.count %}
{% if count > 0 %}
<span class="badge bg-primary">{{ count }}</span>
{% endif %}
{% endwith %} {% endcomment %}
</a>
</li>
{% endblock %}
{% block content %}
@@ -44,7 +51,12 @@
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<td>Site</td>
<td colspan="2">
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Site</th>
<td>
{% if object.site %}
{% if object.site.region %}
@@ -57,7 +69,7 @@
</td>
</tr>
<tr>
<td>Group</td>
<th scope="row">Group</th>
<td>
{% if object.group %}
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
@@ -67,15 +79,15 @@
</td>
</tr>
<tr>
<td>VLAN ID</td>
<th scope="row">VLAN ID</th>
<td>{{ object.vid }}</td>
</tr>
<tr>
<td>Name</td>
<th scope="row">Name</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<td>Tenant</td>
<th scope="row">Tenant</th>
<td>
{% if object.tenant %}
{% if object.tenant.group %}
@@ -88,13 +100,7 @@
</td>
</tr>
<tr>
<td>Status</td>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<td>Role</td>
<th scope="row">Role</th>
<td>
{% if object.role %}
<a href="{% url 'ipam:vlan_list' %}?role={{ object.role.slug }}">{{ object.role }}</a>
@@ -104,7 +110,7 @@
</td>
</tr>
<tr>
<td>Description</td>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>

View File

@@ -3,25 +3,45 @@
{% load helpers %}
{% block form %}
<div class="panel panel-default">
<div class="panel-heading"><strong>VLAN Group</strong></div>
<div class="panel-body">
{% render_field form.name %}
{% render_field form.slug %}
{% render_field form.description %}
</div>
<div class="field-group">
<h4>VLAN Group</h4>
{% render_field form.name %}
{% render_field form.slug %}
{% render_field form.description %}
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Scope</strong>
</div>
<div class="panel-body">
{% with virtual_tab_active=form.initial.cluster %}
<ul class="nav nav-tabs" role="tablist">
<li role="presentation"{% if not virtual_tab_active %} class="active"{% endif %}><a href="#physical" role="tab" data-toggle="tab">Physical</a></li>
<li role="presentation"{% if virtual_tab_active %} class="active"{% endif %}><a href="#virtual" role="tab" data-toggle="tab">Virtual</a></li>
</ul>
<div class="tab-content">
<div class="field-group">
<h4>Scope</h4>
{% with virtual_tab_active=form.initial.cluster %}
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button
role="tab"
type="button"
id="physical_tab"
data-bs-toggle="tab"
aria-controls="physical"
data-bs-target="#physical"
class="nav-link {% if not virtual_tab_active %}active{% endif %}"
>
Physical
</button>
</li>
<li class="nav-item" role="presentation">
<button
role="tab"
type="button"
id="virtual_tab"
data-bs-toggle="tab"
aria-controls="virtual"
data-bs-target="#virtual"
class="nav-link {% if virtual_tab_active %}active{% endif %}"
>
Virtual
</button>
</li>
</ul>
<div class="card my-3">
<div class="card-body tab-content">
<div class="tab-pane{% if not virtual_tab_active %} active{% endif %}" id="physical">
{% render_field form.region %}
{% render_field form.site_group %}
@@ -33,17 +53,15 @@
{% render_field form.cluster_group %}
{% render_field form.cluster %}
</div>
<span class="form-text">The VLAN group will be limited in scope to the most-specific object selected above.</span>
</div>
<span class="help-block">The VLAN group will be limited in scope to the most-specific object selected above.</span>
{% endwith %}
</div>
</div>
{% endwith %}
</div>
{% if form.custom_fields %}
<div class="panel panel-default">
<div class="panel-heading"><strong>Custom Fields</strong></div>
<div class="panel-body">
{% render_custom_fields form %}
</div>
<div class="field-group">
<h4>Custom Fields</h4>
{% render_custom_fields form %}
</div>
{% endif %}
{% endblock %}

View File

@@ -1,24 +1,41 @@
{% extends 'base.html' %}
{% extends 'generic/object.html' %}
{% block title %}{{ object }} - VLANs{% endblock %}
{% block content %}
<div class="row noprint">
<div class="col-sm-12 col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'ipam:vlangroup_list' %}">VLAN Groups</a></li>
{% if object.site %}
<li><a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a></li>
{% endif %}
<li>{{ object }}</li>
</ol>
</div>
</div>
{% include 'ipam/inc/vlangroup_header.html' %}
<div class="row">
<div class="col-md-12">
{% include 'utilities/obj_table.html' with table=vlan_table table_template='panel_table.html' heading='VLANs' bulk_edit_url='ipam:vlan_bulk_edit' bulk_delete_url='ipam:vlan_bulk_delete' %}
</div>
</div>
{% block controls %}
{% if perms.ipam.add_vlan and first_available_vlan %}
<a
href="{% url 'ipam:vlan_add' %}?vid={{ first_available_vlan }}&group={{ object.pk }}{% if object.site %}&site={{ object.site.pk }}{% endif %}"
class="btn btn-sm btn-success m-1">
<i class="bi bi-plus" aria-hidden="true"></i> Add a VLAN
</a>
{% endif %}
{% if perms.ipam.change_vlangroup %}
<a
href="{% url 'ipam:vlangroup_edit' pk=object.pk %}"
class="btn btn-sm btn-warning m-1">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit this VLAN Group
</a>
{% endif %}
{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">
<a href="{% url 'ipam:vlangroup_list' %}">VLAN Groups</a>
</li>
{% if object.site %}
<li class="breadcrumb-item">
<a href="{{ object.site.get_absolute_url }}">{{ object.site }}</a>
</li>
{% endif %}
<li class="breadcrumb-item">{{ object }}</li>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12">
{% include 'utilities/obj_table.html' with table=vlan_table table_template='panel_table.html' heading='VLANs' bulk_edit_url='ipam:vlan_bulk_edit' bulk_delete_url='ipam:vlan_bulk_delete' %}
</div>
</div>
{% endblock %}

View File

@@ -7,8 +7,8 @@
{% block title %}VRF {{ object }}{% endblock %}
{% block breadcrumbs %}
<li><a href="{% url 'ipam:vrf_list' %}">VRFs</a></li>
<li>{{ object }}</li>
<li class="breadcrumb-item"><a href="{% url 'ipam:vrf_list' %}">VRFs</a></li>
<li class="breadcrumb-item">{{ object }}</li>
{% endblock %}
{% block content %}