{# The heading and action switcher shared by the table-definition pages. Every one of them carries a `page` (crate::pages::admin::table_definition:: state::TableDefinitionPageState), whose `active` says which is open. These are deliberately separate pages, for the same reason the permission sections are: adding columns, presenting them, dropping a table, copying a profile and reading its rename history are different decisions. Which links appear follows how much has been selected — the table-wide ones need a table, the profile-wide ones only a profile. #}

{%- if page.selection.has_table() %}{{ page.selection.scope_label(nav.locale) }}{% else %}{{ nav.tr("td-eyebrow-table-definition") }}{% endif -%}

{%- if page.selection.has_table() %}{{ page.selection.table }}{% else %}{{ page.selection.scope_label(nav.locale) }}{% endif -%}

{%- if let Some(detail) = page.detail -%} {{ nav.tr_count("td-columns-count", "count", detail.columns.len() as i64) }} · {{ nav.tr("td-identified-by") }} {%- if detail.row_display_columns.is_empty() %} {{ nav.tr("td-its-id") }} {%- else %} {{ detail.row_display_columns|join(", ") }}{% endif -%} {%- if let Some(summary) = page.selected_table() -%} {%- if !summary.depends_on.is_empty() %} · {{ nav.tr("td-depends-on-prefix") }} {{ summary.depends_on|join(", ") }}{% endif -%} {%- endif -%} . {%- else -%} {{ nav.tr("td-acts-on-profile") }} {%- endif -%}

{{ nav.tr("ui-back-to-admin-panel") }}
{% if page.selection.has_table() && !page.table_is_writable() %}

{{ nav.tr("td-backend-managed-title") }}

{{ nav.tr("td-backend-managed-hint")|safe }}

{% endif %}