{% load i18n %} {% load rack_design %} {# ------------------------------------------------------------------------- #} {# ONE chassis column, shared by the editable chassis layer and the read-only #} {# chassis elevation -- the same split rack_block.html makes for racks, and #} {# for the same reason: the two pages must never drift apart in what they #} {# draw, only in what they let you do. #} {# #} {# Caller supplies: #} {# col one entry of views._chassis_layer_context's chassis_columns #} {# editable True in the editor: adds the drag class, the x remove button #} {# and the widget JSON editor.js parses. False renders the same #} {# columns as static, read-only elevation. #} {# ------------------------------------------------------------------------- #} {# ------------------------------------------------------------------------ #} {# A chassis column is a DEGENERATE RACK, deliberately satisfying the exact #} {# DOM contract initRack() already consumes, so the editor drives it with NO #} {# changes at all (spec §10.3: a chassis IS a rack). #} {# #} {# .nbx-rd-rack-block + data-rack-id -> a synthetic per-column id #} {# data-u-height = bay count (one grid row per bay) #} {# data-desc-units="true" so gsYToUPosition() returns gsY+1 -- i.e. the #} {# 1-based BAY INDEX -- with no arithmetic of its own #} {# one data-face="front" grid; no rear, no tray (a chassis has neither) #} {# #rd-editor-data- the widget JSON, same shape as a rack's #} {# #} {# The rack-only machinery (full-depth shadows, opposite-face hatches, the #} {# tray) never fires here: no bay occupant is full-depth and there is no #} {# second #} {# face for a shadow to land on. data-real-rack-id / data-chassis-* carry #} {# what buildLayoutPayload needs to translate this column's items into the #} {# `bays` bucket the save contract expects (§10.6). #} {# ------------------------------------------------------------------------ #}
{# Two short lines rather than one long one: the header must never be what #} {# decides the column's width. Rack and type live in the tooltip. #}
{% if col.device %}{{ col.label }} {% else %}{{ col.label }} {% trans "planned" %}{% endif %}
{{ col.used }}/{{ col.bay_count }} {% trans "used" %} · {{ col.rack }}
{% for slot in col.slots %}{% if slot.label %}
{% if editable %}{% endif %} {{ slot.label }}
{% endif %}{% endfor %}
{% if editable %}{% with eid="rd-editor-data-"|add:col.grid_id_str %}{{ col.widgets|json_script:eid }}{% endwith %}{% endif %}