talbe definition web

This commit is contained in:
Priec
2026-08-06 17:47:53 +02:00
parent f13def52c1
commit 5f4b026624
14 changed files with 870 additions and 273 deletions

View File

@@ -97,7 +97,7 @@
<option value="no" {% if page.columns.quantity_ledger_input != "yes" %}selected{% endif %}>no</option>
<option value="yes" {% if page.columns.quantity_ledger_input == "yes" %}selected{% endif %}>yes</option>
</select>
<small>INT, BIGINT, DECIMAL or MONEY only.</small>
<small>{{ page.columns.quantity_ledger_types() }} only.</small>
</label>
</div>
@@ -117,12 +117,18 @@
<td><code>{{ column.name }}</code></td>
<td>{{ column.data_type }}</td>
<td>
<button type="button" class="toggle"
hx-post="/admin/table-definition/columns/builder{{ page.selection.query() }}"
hx-include="#column-form" hx-target="#column-panel" hx-swap="innerHTML"
hx-vals='{"action": "toggle-index", "index": "{{ loop.index0 }}"}'>
{% if column.indexed %}[x]{% else %}[ ]{% endif %}
</button>
{# 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) %}
<button type="button" class="toggle"
hx-post="/admin/table-definition/columns/builder{{ page.selection.query() }}"
hx-include="#column-form" hx-target="#column-panel" hx-swap="innerHTML"
hx-vals='{"action": "toggle-index", "index": "{{ loop.index0 }}"}'>
{% if column.indexed %}[x]{% else %}[ ]{% endif %}
</button>
{% else %}
<span class="hint"></span>
{% endif %}
</td>
<td>
{% if column.quantity_ledger %}<span class="tag">quantity ledger</span>{% endif %}

View File

@@ -120,7 +120,7 @@
{% for column in detail.columns %}
<tr>
<td><code>{{ column.name }}</code></td>
<td>{{ column.field_type }}</td>
<td>{{ column.field_type }}{% if !column.sql_type.is_empty() %} <small class="hint">{{ column.sql_type }}</small>{% endif %}</td>
<td>
{%- for flag in column.flags() %}<span class="tag">{{ flag }}</span>{% endfor -%}
</td>