Explorar el Código

Fixes #5174: Ensure consistent alignment of rack elevations

Jeremy Stretch hace 5 años
padre
commit
856500b014

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -4,6 +4,7 @@
 
 ### Bug Fixes
 
+* [#5174](https://github.com/netbox-community/netbox/issues/5174) - Ensure consistent alignment of rack elevations
 * [#5175](https://github.com/netbox-community/netbox/issues/5175) - Fix toggling of rack elevation order
 
 ---

+ 0 - 10
netbox/templates/dcim/inc/rack_elevation_header.html

@@ -1,10 +0,0 @@
-{% load helpers %}
-<div class="rack_header">
-    <strong><a href="{% url 'dcim:rack' pk=rack.pk %}">{{ rack.name }}</a></strong>
-    {% if rack.role %}
-        <br /><small class="label" style="color: {{ rack.role.color|fgcolor }}; background-color: #{{ rack.role.color }}">{{ rack.role }}</small>
-    {% endif %}
-    {% if rack.facility_id %}
-        <br /><small class="text-muted">{{ rack.facility_id }}</small>
-    {% endif %}
-</div>

+ 15 - 2
netbox/templates/dcim/rack_elevation_list.html

@@ -23,10 +23,23 @@
             <div style="white-space: nowrap; overflow-x: scroll;">
                 {% for rack in page %}
                     <div style="display: inline-block; width: 266px">
-                        {% include 'dcim/inc/rack_elevation_header.html' %}
+                        <div class="text-center">
+                            <strong><a href="{% url 'dcim:rack' pk=rack.pk %}">{{ rack.name }}</a></strong>
+                            {% if rack.role %}
+                                <br /><small class="label" style="color: {{ rack.role.color|fgcolor }}; background-color: #{{ rack.role.color }}">{{ rack.role }}</small>
+                            {% endif %}
+                            {% if rack.facility_id %}
+                                <br /><small class="text-muted">{{ rack.facility_id }}</small>
+                            {% endif %}
+                        </div>
                         {% include 'dcim/inc/rack_elevation.html' with face=rack_face %}
                         <div class="clearfix"></div>
-                        {% include 'dcim/inc/rack_elevation_header.html' %}
+                        <div class="text-center">
+                            <strong><a href="{% url 'dcim:rack' pk=rack.pk %}">{{ rack.name }}</a></strong>
+                            {% if rack.facility_id %}
+                                <small class="text-muted">({{ rack.facility_id }})</small>
+                            {% endif %}
+                        </div>
                     </div>
                 {% endfor %}
             </div>