{% load i18n %} {% load l10n %} {% comment %} One face of a concept rack. Localization is switched off below because SVG coordinates must use a dot as the decimal separator whatever the UI language is. {% endcomment %} {% localize off %}
{{ elevation.face_label|title }}
{# Unit rows and legend. An empty unit becomes a click target for adding a device here, exactly like a real rack's elevation. #} {% for unit in elevation.units %} {% if not unit.occupied and can_add_device %} + {% trans "Add device" %} {% else %} {% endif %} {{ unit.number }} {% endfor %} {# Devices #} {% for block in elevation.blocks %} {% comment %} The plain label is always in the markup, image or not - toggling "images only" just layers the (opaque) image on top of it, exactly like NetBox's own rack elevation does. That way there is one code path, not two. {% endcomment %} {% if block.show_text %} {{ block.label }}{% if block.opposite %} ({% trans "rear" %}){% endif %} {% endif %} {% if block.image %} {% if block.show_text %} {# Outlined white-on-black text, drawn as a stroke pass then a fill pass, so it reads over any image without a background box. #} {{ block.label }} {{ block.label }} {% endif %} {% endif %} {{ block.label }}{% if block.sublabel %} · {{ block.sublabel }}{% endif %} · U{{ block.device.position }} {% endfor %}
{% endlocalize %}