{% load lens %} {% comment %} The floor itself. One SVG in room coordinates: the viewBox is the room in centimetres plus a margin for the scale, so every rack is drawn at its true size and the browser does the scaling. Nothing here computes pixels, which is what lets the same markup serve the read-only view and the editor. Each rack is a translated to its centre and then rotated, so a rotation turns the rack where it stands instead of swinging it around a corner. The shapes inside are drawn from half a footprint back, which is what offset_x and offset_y are. Identity and geometry ride on data attributes. The editor reads and writes those, and never re-parses the page. {% endcomment %} {% comment %} A metre grid, not an arbitrary one. The old pattern ruled every 100 cm whatever the room, which in a thirty-metre hall was a mesh and in a comms closet was one line; this is the same step the scale along the edges is labelled in, so a square on the plan is a square somebody can pace out. {% endcomment %} {% comment %} The scale. A plan without one is a picture: it says which rack is beside which, and nothing about how far apart they are or whether a pallet fits down the aisle. Drawn outside the room on two edges, in metres, because metres are what somebody pacing a room counts in. {% endcomment %} {% comment %} Background layers: an architectural drawing or a photograph, placed in room centimetres and stretched to the box it was given. Drawn before the grid so the grid stays readable over it, and in `weight` order, which is what stacks a rack grid over a floor plan over a photograph. {% endcomment %} {% if layers %} {% for layer in layers %} {{ layer.name }} {% endfor %} {% endif %} {% comment %} Cables that leave the room: a stub from the rack to the nearest wall, named after whatever it reaches. Drawn before the rack-to-rack runs so a busy aisle stays the louder line, and both are under the racks, so a run never hides the cabinet it arrives at. {% endcomment %} {% if exits %} {% for exit in exits %} {% if exit.url %}{% endif %} {{ exit.title }} {% if exit.url %}{% endif %} {% endfor %} {% endif %} {% if runs %} {% for run in runs %} {{ run.label }} {% endfor %} {% endif %} {% for p in placed_racks %} {% comment %} Inward, not sideways. A rack on a floor leads to its own view, which is the next level of the same journey; NetBox's own rack page is one click further on from there. Landing on the object page instead ended the journey at its second step. {% endcomment %} {% if linkify %}{% endif %} {{ p.rack.name }}{% if p.label %} · {{ p.label }}{% endif %}{% if p.estimated %} · footprint estimated{% endif %} {% comment %} A bar on the front edge, so a rotated rack still says which way it faces. Without it a 180-degree rotation is invisible and the plan cannot be checked against the room. {% endcomment %} {% comment %} The gauge. A band alone cannot tell 12% from 48%: both are "under 50%", both draw the same green box, and a whole room came out one colour saying nothing. This carries the magnitude the band rounds away. Only for an overlay measuring a quantity; a role or a cooling capability has no "how much" to draw. {% endcomment %} {% if p.fraction != None %} {% endif %} {% comment %} The size is inline, not an SVG presentation attribute: the stylesheet's rule for this class would win over an attribute and every name would draw at one size again. It is the same size for every rack on the floor, set from the smallest cabinet, so the plan reads as one drawing rather than as a ransom note. {% endcomment %} {{ p.display_name|default:p.rack.name }} {% if p.fraction != None %} {{ p.gauge_label }} {% endif %} {% if linkify %}{% endif %} {% endfor %}