aliasing now move column position also

This commit is contained in:
Priec
2026-08-14 21:23:14 +02:00
parent 5792a1f533
commit c3f5046c85
17 changed files with 164 additions and 86 deletions

View File

@@ -28,25 +28,24 @@
<section class="panel">
<h2>{{ nav.tr("td-rename-column") }}</h2>
<p class="hint">{{ nav.tr("td-rename-hint") }}</p>
<form hx-post="/admin/tables/rename"
<form hx-post="/admin/tables/presentation"
hx-target="#table-panel" hx-swap="innerHTML">
<input type="hidden" name="profile" value="{{ page.selection.profile }}">
<input type="hidden" name="table" value="{{ page.selection.table }}">
<div class="form-grid">
<label>{{ nav.tr("td-column-label") }}
<select name="old_column_name">
<option value="">{{ nav.tr("td-choose-column") }}</option>
{% for column in detail.renameable_columns() %}
<option value="{{ column.name }}" {% if page.rename.old_column_name == column.name %}selected{% endif %}>{{ column.name }}</option>
{% endfor %}
</select>
</label>
<label>{{ nav.tr("td-new-name") }}
<input name="new_column_name" value="{{ page.rename.new_column_name }}" placeholder="invoice_number">
</label>
{% for column in detail.columns %}
<input type="hidden" name="column_ids" value="{{ column.column_id }}">
<label>{{ nav.tr("td-column-label") }}
<input name="aliases" value="{{ column.name }}" {% if !column.renameable %}readonly{% endif %}>
</label>
<div class="form-actions">
<button type="submit" name="action" value="up:{{ loop.index0 }}" {% if loop.first %}disabled{% endif %}></button>
<button type="submit" name="action" value="down:{{ loop.index0 }}" {% if loop.last %}disabled{% endif %}></button>
</div>
{% endfor %}
</div>
<div class="form-actions">
<button type="submit">{{ nav.tr("td-rename-button") }}</button>
<button type="submit" name="action" value="save">{{ nav.tr("td-rename-button") }}</button>
</div>
</form>
</section>