{# What is on the mirror, as its three bands (top, middle, bottom), each with left, center and right. Heights follow the content, so a busy position never squeezes the others. Needs screen_layout; with interactive set, a module opens its settings and has a switch that turns it on or off. #} {% macro icon(m) %}{% if m.icon.startswith('data:') %}{% else %}{% endif %}{% endmacro %}
{% for row in ['top', 'middle', 'bottom'] %}
{{ row|capitalize }}
{% for col in ['left', 'center', 'right'] %} {% set placed = screen_layout.get(row ~ '_' ~ col, []) %}
{% for m in placed %} {% if not m.module %}
{{ icon(m) }} {{ m.name }} {% if m.disabled_reason %}Off: {{ m.disabled_reason }}{% else %}Not installed{% endif %} {% if interactive %} {# Its module is gone (uninstalled elsewhere, a backup from another mirror), so only the settings are left #} {% endif %}
{% elif interactive %} {# The name is the button; its ::after covers the tile, the switch sits above it #}
{{ icon(m) }}
{% else %}
{{ icon(m) }}{% if not m.enabled %}Off{% endif %} {{ m.name }}
{% endif %} {% endfor %}
{% endfor %}
{% endfor %}