{% extends 'netbox_rack_design/design_editor.html' %} {% load i18n %} {% load rack_design %} {# ------------------------------------------------------------------------- #} {# The CHASSIS LAYER (spec §10.3). #} {# #} {# Deliberately EXTENDS the rack editor rather than forking it: the drawer, #} {# the legend/role/tenant toolbar and Save are identical, because a chassis #} {# IS a rack here -- bays in place of units. Only three things differ, and #} {# each is an override block on the parent template: #} {# #} {# rd_canvas chassis columns instead of rack blocks #} {# rd_scope_panel a Chassis panel instead of the Racks panel #} {# rd_layer_switch a way back to the rack view #} {# #} {# The palette itself is filtered to child device types by editor.js, which #} {# reads data-rd-chassis-layer on the root -- so a non-child type can never be #} {# offered as a bay occupant in the first place. #} {# ------------------------------------------------------------------------- #} {# The drawer's third section holds chassis here, not racks. #} {% block rd_scope_section_label %}{% trans "Chassis" %}{% endblock %} {% block rd_layer_switch %} {# Not labelled "Racks": the drawer already has a Racks/Chassis section toggle #} {# and two identical labels in one button row is unreadable. #} {% trans "Rack view" %} {% endblock rd_layer_switch %} {% block rd_scope_panel %}

{% trans "Chassis" %}

{# Same show/hide contract as the Racks panel: HIDDEN state is stored, so a #} {# chassis with no row is visible. Toggling never touches the design. #}
{% for row in chassis_rows %}
{{ row.label }}
{{ row.rack }} · {{ row.used }}/{{ row.bay_count }} {% trans "bays used" %} {% if not row.device %}· {% trans "planned" %}{% endif %}
{# A PLANNED chassis has no device row, so there is nothing to persist a #} {# hidden state against -- and hiding what you just added would be #} {# unhelpful anyway. It is always visible. #} {% if row.device %} {% endif %}
{% empty %}
{% trans "No chassis in this design's scope." %}
{% endfor %}
{% endblock rd_scope_panel %} {% block rd_canvas %}
{% for col in chassis_columns %} {% include 'netbox_rack_design/inc/chassis_column.html' with col=col editable=editable_layer %} {% empty %}

{% trans "No chassis in this design's scope — add a parent device in the rack view first." %}

{% endfor %}
{% endblock rd_canvas %}