web add table fix in naming

This commit is contained in:
Priec
2026-08-13 22:48:29 +02:00
parent 2b68560359
commit df145c14f7
5 changed files with 89 additions and 21 deletions

View File

@@ -338,7 +338,9 @@
#}
{% if !page.alias_rows().is_empty() %}
<section class="builder-section">
<details class="rename-generated">
{# Open once a name has been asked for: the section is where those names are
read back, and a swap that closed it would hide what was just applied. #}
<details class="rename-generated" {% if page.draft.has_generated_aliases() %}open{% endif %}>
<summary>Rename generated columns</summary>
<p class="hint">These columns come from the definition rows above. Give one a name of your own, or leave it empty to keep the name shown.</p>
<ul class="rename-list">
@@ -352,6 +354,14 @@
</li>
{% endfor %}
</ul>
{#
A text field posts nothing on its own here, so the names typed above are
only carried by the next request. This button is that request: it applies
them, so the column list and the preview show the renamed columns.
#}
<button type="button" class="secondary" hx-post="/admin/tables/builder" hx-include="#table-form"
hx-target="#builder" hx-swap="innerHTML"
hx-vals='{"action": "apply-generated-names"}'>Apply names</button>
</details>
</section>
{% endif %}