web fixes

This commit is contained in:
Priec
2026-08-14 18:46:31 +02:00
parent 0e6207fb44
commit 1c3d292479
13 changed files with 1458 additions and 105 deletions

View File

@@ -118,12 +118,32 @@
</label>
{% 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() %}
<label>Indexing
<select name="column_indexing_input">
<option value="no" {% if page.columns.indexing_input != "yes" %}selected{% endif %}>no</option>
<option value="yes" {% if page.columns.indexing_input == "yes" %}selected{% endif %}>yes</option>
</select>
</label>
{% else if page.columns.pending_is_auto_indexed() %}
<div class="field-note">
<span class="field-label">Indexing</span>
<p class="hint">Indexed automatically — a link is a foreign key, and the server indexes every one of them.</p>
</div>
{% endif %}
<label>Required
<select name="column_required_input">
<option value="no" {% if page.columns.required_input != "yes" %}selected{% endif %}>no</option>
<option value="yes" {% if page.columns.required_input == "yes" %}selected{% endif %}>yes</option>
</select>
<small>A row must carry a value for it.</small>
</label>
{% if page.columns.show_quantity_ledger() %}
<label>Quantity ledger
<select name="column_quantity_ledger_input">
<option value="no" {% if page.columns.quantity_ledger_input != "yes" %}selected{% endif %}>no</option>
@@ -131,6 +151,9 @@
</select>
<small>{{ page.columns.quantity_ledger_types() }} only.</small>
</label>
{% else %}
<p class="hint">A shared table keeps no books of its own, so it cannot hold a quantity-ledger column.</p>
{% endif %}
</div>
<button type="button" class="secondary"
@@ -158,13 +181,16 @@
hx-vals='{"action": "toggle-index", "index": "{{ loop.index0 }}"}'>
{% if column.indexed %}[x]{% else %}[ ]{% endif %}
</button>
{% else if column.is_indexed() %}
<span class="tag">indexed automatically</span>
{% else %}
<span class="hint"></span>
{% endif %}
</td>
<td>
{% if column.required %}<span class="tag">required</span>{% endif %}
{% if column.quantity_ledger %}<span class="tag">quantity ledger</span>{% endif %}
{% if !column.option_label().is_empty() %}<span class="tag">{{ column.option_label() }}</span>{% endif %}
{% if !column.currency.is_empty() %}<span class="tag">{{ column.currency }}, {{ column.money_mode.label() }}</span>{% endif %}
</td>
<td>
<button type="button" class="danger"
@@ -184,6 +210,7 @@
<input type="hidden" name="column_types" value="{{ column.data_type }}">
<input type="hidden" name="column_indexed" value="{% if column.indexed %}yes{% else %}no{% endif %}">
<input type="hidden" name="column_quantity_ledger" value="{% if column.quantity_ledger %}yes{% else %}no{% endif %}">
<input type="hidden" name="column_required" value="{% if column.required %}yes{% else %}no{% endif %}">
<input type="hidden" name="column_rounding" value="{{ column.money_mode.label() }}">
<input type="hidden" name="column_currencies" value="{{ column.currency }}">
{% endfor %}