fixes
This commit is contained in:
@@ -3,30 +3,55 @@
|
||||
|
||||
{% if page.table_is_writable() %}
|
||||
{% if let Some(detail) = page.detail %}
|
||||
{# One form per column, each carrying its own column id: an alias is never
|
||||
posted apart from the column it was typed into. #}
|
||||
<section class="panel">
|
||||
<h2>{{ nav.tr("td-rename-column") }}</h2>
|
||||
<p class="hint">{{ nav.tr("td-rename-hint") }}</p>
|
||||
<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 }}">
|
||||
<input type="hidden" name="expected_row_version" value="{{ detail.row_version }}">
|
||||
<div class="form-grid">
|
||||
{% 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>
|
||||
{% for column in detail.columns %}
|
||||
{% if column.renameable %}
|
||||
<form hx-post="/admin/tables/presentation/alias"
|
||||
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 }}">
|
||||
<input type="hidden" name="expected_row_version" value="{{ detail.row_version }}">
|
||||
<input type="hidden" name="column_id" value="{{ column.column_id }}">
|
||||
<div class="form-grid">
|
||||
<label>{{ nav.tr("td-column-label") }}
|
||||
<input name="alias" value="{{ column.name }}">
|
||||
</label>
|
||||
<div class="form-actions">
|
||||
<button type="submit">{{ nav.tr("td-rename-button") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" name="action" value="save">{{ nav.tr("td-rename-button") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="hint"><code>{{ column.name }}</code> — {{ nav.tr("td-alias-locked") }}</p>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
{# The order forms carry no alias at all, so moving a column cannot rename
|
||||
one. The names below are labels, not inputs. #}
|
||||
<section class="panel">
|
||||
<h2>{{ nav.tr("td-order-heading") }}</h2>
|
||||
<p class="hint">{{ nav.tr("td-order-hint") }}</p>
|
||||
<ol class="column-order">
|
||||
{% for column in detail.columns %}
|
||||
<li>
|
||||
<code>{{ column.name }}</code>
|
||||
<form hx-post="/admin/tables/presentation/order"
|
||||
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 }}">
|
||||
<input type="hidden" name="expected_row_version" value="{{ detail.row_version }}">
|
||||
<input type="hidden" name="column_id" value="{{ column.column_id }}">
|
||||
<button type="submit" name="direction" value="up" {% if loop.first %}disabled{% endif %}>↑</button>
|
||||
<button type="submit" name="direction" value="down" {% if loop.last %}disabled{% endif %}>↓</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
<small>{{ nav.tr("export-comma-hint") }}</small>
|
||||
</label>
|
||||
</div>
|
||||
<label class="check">
|
||||
<input type="checkbox" name="include_system_columns" value="true">
|
||||
{{ nav.tr("export-include-system") }}
|
||||
</label>
|
||||
<small>{{ nav.tr("export-include-system-hint") }}</small>
|
||||
<datalist id="export-tables">
|
||||
{%- for profile in page.catalog.profiles %}{% for table in profile.tables %}<option value="{{ table }}"></option>{% endfor %}{% endfor -%}
|
||||
</datalist>
|
||||
|
||||
Reference in New Issue
Block a user