{# ==================================================================== #} {# Finding D (v0.4.0): slot ledger table. #} {# #} {# Renders above the SVG on the Device Layout tab when the #} {# SLOT_LEDGER_ENABLED plugin setting is True. Receives one context #} {# variable: #} {# #} {# ledger_sections: list[MountSection] (from ledger.enumerate_ledger)#} {# #} {# Per the v0.4.0 UX decisions (no collapse, bay-empty is informational #} {# not yellow, β-ledger sub-rows under hosted devices). #} {# ==================================================================== #} {% if ledger_sections %}
Slot ledger opt-in; toggle off via SLOT_LEDGER_ENABLED=False
{% for section in ledger_sections %}
{# -------- section header: mount name + occupancy bar -------- #}
{{ section.mount.name }} {{ section.mount.get_mount_type_display }}{% if section.mount.subtype %}, {{ section.mount.get_subtype_display }}{% endif %}
{% if section.capacity %}
{{ section.populated_count }} / {{ section.capacity }} · {{ section.occupancy_pct }}% {% else %} 2D plate {% endif %} Placement
{# -------- rows table -------- #}
{% for row in section.rows %} {# -------- β-ledger sub-rows: populated ModuleBays -------- #} {% for sub in row.sub_rows %} {% endfor %} {% endfor %}
Slot Size Device Role Type Bay Action
{{ row.slot_label }} {{ row.size_label }} {% if row.device_url %} {{ row.device_name }} {% elif row.state == 'empty' %} (empty) {% elif row.state == 'bay_empty' or row.state == 'module_empty' %} (bay empty) {% elif row.state == 'dangling' %} {{ row.device_name }} {% else %} {{ row.device_name }} {% endif %} {{ row.role|default:"—" }} {{ row.type_name }} {{ row.bay_label }} {% if row.action_url %} {{ row.action_label }} {% endif %}
{{ sub.slot_label }} {{ sub.module_name }} {{ sub.role|default:"—" }} {{ sub.module_type }}
{% endfor %}
{% endif %}