global table content

This commit is contained in:
Priec
2026-08-12 14:10:20 +02:00
parent 112bea6519
commit 78e3f1ae08
7 changed files with 54 additions and 17 deletions

View File

@@ -9,7 +9,7 @@
<div>
<p class="eyebrow">Table definition</p>
<h1>Table definition</h1>
<p>Pick a profile and a table, then change its definition.</p>
<p>Choose Global to manage tables shared by every profile, or choose a profile to manage only its own tables.</p>
</div>
<div class="actions">
<a href="/admin">← Admin panel</a>

View File

@@ -45,10 +45,11 @@
<section class="panel">
<h2>Selection</h2>
<div class="form-grid">
<label>Profile
<label>Scope
<select name="profile" hx-get="/admin/table-definition/workspace"
hx-target="#table-definition-workspace" hx-swap="innerHTML">
<option value="">Choose a profile</option>
<option value="">Choose a scope</option>
<option value="__global" {% if page.selection.is_global() %}selected{% endif %}>Global — all profiles</option>
{% for profile in page.profiles %}
<option value="{{ profile }}" {% if page.selection.profile == *profile %}selected{% endif %}>{{ profile }}</option>
{% endfor %}
@@ -73,7 +74,11 @@
{% if page.selection.has_profile() %}
<div class="actions panel-actions">
<a href="/admin/tables/new?profile={{ page.selection.profile }}">+ Create a table in this profile</a>
{% if page.selection.is_global() %}
<a href="/admin/tables/new?global=true">+ Create a global table</a>
{% else %}
<a href="/admin/tables/new?profile={{ page.selection.profile }}">+ Create a table in this profile</a>
{% endif %}
</div>
{% if page.tables.is_empty() %}
@@ -253,7 +258,7 @@
</section>
{% endif %}
{% if page.selection.has_profile() %}
{% if page.selection.has_profile() && !page.selection.is_global() %}
<section class="panel">
<h2>Copy <code>{{ page.selection.profile }}</code> into a new profile</h2>
<p class="hint">Copies structure — tables, links and scripts — and no rows. Leave every table unticked to copy the whole profile.</p>