{# The append-columns panel — crate::pages::admin::table_definition::ui::ColumnPanelFragment, and what workspace.html embeds inside #column-form. Staging a column writes nothing, so these buttons swap this panel alone. Saving is the form's own submit, which swaps the whole workspace. The field names are the ones crate::schema::ColumnForm declares — the same set the Add-table builder posts, decoded by the same code. #} {# Staging swaps this panel and nothing else, so a refused column has nowhere else to be reported. When the workspace embeds the panel it reports the outcome at the top instead, and this block stays out of the way. #} {% import "ui/alert.html" as panel_alert %} {% import "ui/dialog.html" as panel_dialog %} {% import "ui/toast.html" as panel_toast %} {% if standalone_column_panel %} {%- if let Some(message) = page.error %}{% call panel_alert::error("Could not add the column", message) %}{% endcall %}{% endif -%} {%- if let Some(message) = page.status %}{% call panel_toast::success("Staged", message) %}{% endcall %}{% endif -%} {%- if let Some(message) = page.error %}{% call panel_dialog::error("Could not add the column", message) %}{% endcall %}{% endif -%} {% endif %}
{% if page.columns.show_temporal_type() %} {% endif %} {% if page.columns.show_gtin_type() %} {% endif %} {% if page.columns.show_decimal_arguments() %} {% endif %} {% if page.columns.show_link_target() %} {% endif %} {% if page.columns.show_money_options() %} {% endif %} {# A link is left out rather than defaulted to "no": the server builds an index for every foreign key as it adds the column, and refuses a request that asks for one on top. #} {% if page.columns.show_indexing() %} {% else if page.columns.pending_is_auto_indexed() %}
Indexing

Indexed automatically — a link is a foreign key, and the server indexes every one of them.

{% endif %} {% if page.columns.show_quantity_ledger() %} {% else %}

A shared table keeps no books of its own, so it cannot hold a quantity-ledger column.

{% endif %}
{% if page.columns.added.is_empty() %}

No columns staged yet. Describe one above and press Stage column.

{% else %} {% for column in page.columns.added %} {% endfor %}
NameTypeIndexedOptions
{{ column.name }} {{ column.data_type }} {# A compound column expands into schema-managed companions, so there is no column of its own name to index. #} {% if page.columns.is_indexable(*loop.index0) %} {% else if column.is_indexed() %} indexed automatically {% else %} {% endif %} {% if column.required %}required{% endif %} {% if column.quantity_ledger %}quantity ledger{% endif %} {% if !column.currency.is_empty() %}{{ column.currency }}, {{ column.money_mode.label() }}{% endif %}
{% endif %} {# The staged columns themselves: one set of fields per column, in order. #} {% for column in page.columns.added %} {% endfor %}