webs unified
This commit is contained in:
25
web/templates/pages/admin/admin/admin.html
Normal file
25
web/templates/pages/admin/admin/admin.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{# GET /admin — crate::pages::admin::admin::ui::AdminPage #}
|
||||
{% extends "ui/base.html" %}
|
||||
|
||||
{% block title %}Admin panel{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<section class="heading">
|
||||
<div>
|
||||
<p class="eyebrow">Workspace</p>
|
||||
<h1>Admin panel</h1>
|
||||
<p>Browse profiles, tables, and their physical columns.</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a href="/admin/tables/new">Add table</a>
|
||||
<a href="/admin/logic/new">Add logic</a>
|
||||
<a href="/admin/validation/new">Add validation</a>
|
||||
<a href="/admin/validation/sets/new">Add rule</a>
|
||||
<a href="/admin/import">Import</a>
|
||||
<a href="/admin/export">Export</a>
|
||||
</div>
|
||||
</section>
|
||||
<div id="admin-workspace">{% include "pages/admin/admin/workspace.html" %}</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
69
web/templates/pages/admin/admin/workspace.html
Normal file
69
web/templates/pages/admin/admin/workspace.html
Normal file
@@ -0,0 +1,69 @@
|
||||
{#
|
||||
GET /admin/workspace — crate::pages::admin::admin::ui::AdminWorkspace
|
||||
Also included by pages/admin.html for the first paint. Both structs expose
|
||||
the same `page: AdminPageState` field.
|
||||
#}
|
||||
<div class="workspace" aria-live="polite">
|
||||
<section class="pane">
|
||||
<div class="pane-title"><h2>Profiles</h2><span>{{ page.profiles.len() }}</span></div>
|
||||
<div class="pane-list">
|
||||
{% if page.profiles.is_empty() %}
|
||||
<p class="empty">No profiles available.</p>
|
||||
{% else %}
|
||||
{% for profile in page.profiles %}
|
||||
<form hx-get="/admin/workspace" hx-target="#admin-workspace" hx-swap="innerHTML">
|
||||
<button class="browser-item {% if page.selected_profile.as_deref() == Some(profile.name.as_str()) %}selected{% endif %}"
|
||||
type="submit" name="profile" value="{{ profile.name }}">
|
||||
<span>{{ profile.name }}</span>
|
||||
<small>{{ profile.table_count }} tables</small>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="pane">
|
||||
<div class="pane-title"><h2>Tables</h2><span>{{ page.tables.len() }}</span></div>
|
||||
<div class="pane-list">
|
||||
{% if page.selected_profile.is_none() %}
|
||||
<p class="empty">Select a profile to see its tables.</p>
|
||||
{% else if page.tables.is_empty() %}
|
||||
<p class="empty">This profile has no tables.</p>
|
||||
{% else %}
|
||||
{% for table in page.tables %}
|
||||
<form hx-get="/admin/workspace" hx-target="#admin-workspace" hx-swap="innerHTML">
|
||||
<input type="hidden" name="profile" value="{{ page.selected_profile.as_deref().unwrap_or_default() }}">
|
||||
<button class="browser-item {% if page.selected_table.as_deref() == Some(table.name.as_str()) %}selected{% endif %}"
|
||||
type="submit" name="table" value="{{ table.name }}">
|
||||
<span>{{ table.name }}</span>
|
||||
<small>
|
||||
{%- if table.depends_on.is_empty() %}No dependencies{% else %}Depends on {{ table.depends_on|join(", ") }}{% endif %}
|
||||
· display: {{ table.row_display_columns|join(", ") }}
|
||||
</small>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="pane">
|
||||
<div class="pane-title"><h2>Columns</h2><span>{{ page.columns.len() }}</span></div>
|
||||
<div class="pane-list">
|
||||
{% if page.selected_table.is_none() %}
|
||||
<p class="empty">Select a table to inspect its columns.</p>
|
||||
{% else if page.columns.is_empty() %}
|
||||
<p class="empty">This table has no visible columns.</p>
|
||||
{% else %}
|
||||
{% for column in page.columns %}
|
||||
<div class="column">
|
||||
<span>{{ column.name }}</span>
|
||||
<code>{{ column.data_type }}</code>
|
||||
<small>{{ column.flags()|join(" · ") }}</small>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
Reference in New Issue
Block a user