06/16 Phase 6 (continue)

This commit is contained in:
2026-06-17 17:06:43 -04:00
parent 479afde2fa
commit 68a842d6b6
26 changed files with 1027 additions and 61 deletions
+38
View File
@@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block title %}{{ _('Admin · Categories') }}{% endblock %}
{% block content %}
{% include "admin/_nav.html" %}
<div class="card">
<h2>{{ _('Categories') }}</h2>
<table class="list">
{% for cat in categories %}
<tr>
<td><strong>{{ cat.name }}</strong> <code class="muted small">{{ cat.slug }}</code></td>
<td><span class="badge {{ 'ok' if cat.is_active else 'warn' }}">{{ _('active') if cat.is_active else _('inactive') }}</span></td>
<td class="muted small">{{ cat.children|length }} {{ _('subcategories') }}</td>
<td>
<a class="btn ghost tiny" href="{{ url_for('admin.category_schema', cat_id=cat.id) }}">{{ _('Field schema') }}</a>
<form method="post" action="{{ url_for('admin.toggle_category', cat_id=cat.id) }}" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn ghost tiny" type="submit">{{ _('Disable') if cat.is_active else _('Enable') }}</button>
</form>
</td>
</tr>
{% for sub in cat.children|sort(attribute='sort_order') %}
<tr style="background:var(--bg2)">
<td style="padding-left:24px">{{ sub.name }} <code class="muted small">{{ sub.slug }}</code></td>
<td><span class="badge {{ 'ok' if sub.is_active else 'warn' }}">{{ _('active') if sub.is_active else _('inactive') }}</span></td>
<td></td>
<td>
<a class="btn ghost tiny" href="{{ url_for('admin.category_schema', cat_id=sub.id) }}">{{ _('Field schema') }}</a>
<form method="post" action="{{ url_for('admin.toggle_category', cat_id=sub.id) }}" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn ghost tiny" type="submit">{{ _('Disable') if sub.is_active else _('Enable') }}</button>
</form>
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
{% endblock %}