2
0
Jeremy Stretch 5 жил өмнө
parent
commit
8348c5a674

+ 18 - 3
netbox/dcim/views.py

@@ -2144,7 +2144,7 @@ class ConsoleConnectionsListView(ObjectListView):
     filterset = filters.ConsoleConnectionFilterSet
     filterset_form = forms.ConsoleConnectionFilterForm
     table = tables.ConsoleConnectionTable
-    template_name = 'dcim/console_connections_list.html'
+    template_name = 'dcim/connections_list.html'
 
     def queryset_to_csv(self):
         csv_data = [
@@ -2163,13 +2163,18 @@ class ConsoleConnectionsListView(ObjectListView):
 
         return '\n'.join(csv_data)
 
+    def extra_context(self):
+        return {
+            'title': 'Console Connections'
+        }
+
 
 class PowerConnectionsListView(ObjectListView):
     queryset = PowerPort.objects.filter(_path__isnull=False).order_by('device')
     filterset = filters.PowerConnectionFilterSet
     filterset_form = forms.PowerConnectionFilterForm
     table = tables.PowerConnectionTable
-    template_name = 'dcim/power_connections_list.html'
+    template_name = 'dcim/connections_list.html'
 
     def queryset_to_csv(self):
         csv_data = [
@@ -2188,6 +2193,11 @@ class PowerConnectionsListView(ObjectListView):
 
         return '\n'.join(csv_data)
 
+    def extra_context(self):
+        return {
+            'title': 'Power Connections'
+        }
+
 
 class InterfaceConnectionsListView(ObjectListView):
     queryset = Interface.objects.filter(
@@ -2198,7 +2208,7 @@ class InterfaceConnectionsListView(ObjectListView):
     filterset = filters.InterfaceConnectionFilterSet
     filterset_form = forms.InterfaceConnectionFilterForm
     table = tables.InterfaceConnectionTable
-    template_name = 'dcim/interface_connections_list.html'
+    template_name = 'dcim/connections_list.html'
 
     def queryset_to_csv(self):
         csv_data = [
@@ -2219,6 +2229,11 @@ class InterfaceConnectionsListView(ObjectListView):
 
         return '\n'.join(csv_data)
 
+    def extra_context(self):
+        return {
+            'title': 'Interface Connections'
+        }
+
 
 #
 # Virtual chassis

+ 5 - 0
netbox/project-static/css/base.css

@@ -33,6 +33,11 @@ footer p {
 #navbar_search {
     padding: 0 8px;
 }
+.right-side-panel {
+    max-width: 400px;
+    min-width: 300px;
+    padding-right: 0;
+}
 
 /* Hide the username in the navigation menu on displays less than 1400px wide */
 @media (max-width: 1399px) {

+ 5 - 5
netbox/templates/dcim/console_connections_list.html → netbox/templates/dcim/connections_list.html

@@ -5,14 +5,14 @@
 <div class="pull-right noprint">
     {% export_button content_type %}
 </div>
-<h1>{% block title %}Console Connections{% endblock %}</h1>
+<h1>{% block title %}{{ title }}{% endblock %}</h1>
 <div class="row">
-	<div class="col-md-9">
+	  <div class="col-md-12">
+        <div class="col-md-3 pull-right right-side-panel noprint">
+            {% include 'inc/search_panel.html' %}
+        </div>
         {% include 'responsive_table.html' %}
         {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
     </div>
-    <div class="col-md-3 noprint">
-		{% include 'inc/search_panel.html' %}
-    </div>
 </div>
 {% endblock %}

+ 0 - 18
netbox/templates/dcim/interface_connections_list.html

@@ -1,18 +0,0 @@
-{% extends 'base.html' %}
-{% load buttons %}
-
-{% block content %}
-<div class="pull-right noprint">
-    {% export_button content_type %}
-</div>
-<h1>{% block title %}Interface Connections{% endblock %}</h1>
-<div class="row">
-	<div class="col-md-9">
-        {% include 'responsive_table.html' %}
-        {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
-    </div>
-    <div class="col-md-3 noprint">
-		{% include 'inc/search_panel.html' %}
-    </div>
-</div>
-{% endblock %}

+ 0 - 18
netbox/templates/dcim/power_connections_list.html

@@ -1,18 +0,0 @@
-{% extends 'base.html' %}
-{% load buttons %}
-
-{% block content %}
-<div class="pull-right noprint">
-    {% export_button content_type %}
-</div>
-<h1>{% block title %}Power Connections{% endblock %}</h1>
-<div class="row">
-	<div class="col-md-9">
-        {% include 'responsive_table.html' %}
-        {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
-    </div>
-    <div class="col-md-3 noprint">
-		{% include 'inc/search_panel.html' %}
-    </div>
-</div>
-{% endblock %}

+ 7 - 9
netbox/templates/dcim/rack_elevation_list.html

@@ -18,8 +18,11 @@
 </div>
 <h1>{% block title %}Rack Elevations{% endblock %}</h1>
 <div class="row">
-    {% if page %}
-        <div class="col-md-9">
+    <div class="col-md-12">
+        <div class="col-md-3 pull-right right-side-panel noprint">
+            {% include 'inc/search_panel.html' %}
+        </div>
+        {% if page %}
             <div style="white-space: nowrap; overflow-x: scroll;">
                 {% for rack in page %}
                     <div style="display: inline-block; width: 266px">
@@ -45,14 +48,9 @@
             </div>
             <br />
             {% include 'inc/paginator.html' %}
-        </div>
-    {% else %}
-        <div class="col-md-9">
+        {% else %}
             <p>No racks found</p>
-        </div>
-    {% endif %}
-    <div class="col-md-3 noprint">
-		{% include 'inc/search_panel.html' %}
+        {% endif %}
     </div>
 </div>
 {% endblock %}

+ 7 - 7
netbox/templates/utilities/obj_list.html

@@ -21,7 +21,13 @@
 </div>
 <h1>{% block title %}{{ content_type.model_class|meta:"verbose_name_plural"|bettertitle }}{% endblock %}</h1>
 <div class="row">
-    <div class="col-md-{% if filter_form %}9{% else %}12{% endif %}">
+    <div class="col-md-12">
+        {% if filter_form %}
+            <div class="col-md-3 pull-right right-side-panel noprint">
+                {% include 'inc/search_panel.html' %}
+                {% block sidebar %}{% endblock %}
+            </div>
+        {% endif %}
         {% with bulk_edit_url=content_type.model_class|validated_viewname:"bulk_edit" bulk_delete_url=content_type.model_class|validated_viewname:"bulk_delete" %}
         {% if permissions.change or permissions.delete %}
             <form method="post" class="form form-horizontal">
@@ -73,12 +79,6 @@
         {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
         <div class="clearfix"></div>
     </div>
-    {% if filter_form %}
-        <div class="col-md-3 noprint">
-            {% include 'inc/search_panel.html' %}
-            {% block sidebar %}{% endblock %}
-        </div>
-    {% endif %}
 </div>
 {% table_config_form table table_name="ObjectTable" %}
 {% endblock %}