{% from "components/primitives/canonical_table.html" import canonical_table %} {% set tb = block.toolbar %} {% set has_toolbar = tb.search or tb.entries or tb.actions or tb.fields or tb.hidden or tb.column_toggles or tb.reset or tb.apply %} {% call canonical_table(title=block.title, description=block.description, pagination=block.pagination, toolbar=tb if has_toolbar else none, form_action=block.form_action, locale=locale) %} {% if block.degraded_error %}
{% else %}
{% if block.columns %} {% if block.selectable %}{% endif %} {% for col in block.columns %} {% if col.sortable and col.sort_href %}{{ col.label }} {% else %}{{ col.label }}{% endif %} {% endfor %} {% for row in block.rows %} {% if block.selectable %}{% endif %} {% for col in block.columns %} {% set cell = row.get(col.key, {}) %} {% if cell.type == "text" %} {% if cell.tone %}{{ cell.value }}{% else %}{{ cell.value }}{% endif %} {% elif cell.type == "link" %} {% if cell.href %}{{ cell.label }}{% else %}{{ cell.label }}{% endif %} {% elif cell.type == "badge" %} {{ cell.label }} {% elif cell.type == "status" %} {{ cell.label }} {% elif cell.type == "avatar_text" %}
{% if cell.initials %}{{ cell.initials }}{% else %}?{% endif %}
{{ cell.title }}
{% if cell.subtitle %}
{{ cell.subtitle }}
{% endif %}
{% elif cell.type == "progress" %}
{{ cell.label }}
{% elif cell.type == "actions" %}
{% for action in cell.get("items", []) %} {% if action.href %}{{ action.label }}{% else %}{{ action.label }}{% endif %} {% endfor %}
{% else %} {{ cell.value if cell.value else ("н/д" if locale == 'ru' else "n/a") }} {% endif %} {% endfor %}
{% endfor %} {% endif %}
{% endif %} {% endcall %}