1.5 KiB · text History 263b40b
{% extends "root.html" %}
{# Manage categories, Focus (src/handlers/categories.rs manage_focus): the
   top level as cards with their subcategories nested inside, down to the
   depth limit, each level ending in a `+` that adds one inline. Full width,
   as the other Focus pages. #}
{% block width %}w-full max-w-none{% endblock %}
{% block main_class %}px-3 py-3 sm:px-4 lg:px-5{% endblock %}
{% block layout %}focus{% endblock %}
{% block content %}
<div class="space-y-4 text-left">
  <div class="flex flex-wrap items-center justify-between gap-3">
    <div>
      <h1 class="text-3xl font-bold">Manage categories</h1>
      <p class="text-sm opacity-60">Up to {{ max_depth }} levels. <kbd class="kbd kbd-xs">+</kbd> adds one in place; Esc cancels.</p>
    </div>
    <div class="flex flex-wrap items-center gap-2">
      {% set toggle_base = "/admin/categories" %}{% set view_mode = "focus" %}
      {% include "forum/_view_toggle.html" %}
      <a href="/admin/categories/new" class="btn btn-ghost btn-sm" title="The full form: slug, description, position, parent">
        <i class="fas fa-file-pen mr-1"></i> Full form
      </a>
    </div>
  </div>

  <div id="cat-board" class="grid grid-cols-[repeat(auto-fill,minmax(26rem,1fr))] items-start gap-4">
    {% for card in cards %}
      {% with node = card %}{% include "admin/_category_card.html" %}{% endwith %}
    {% endfor %}
    {% if add %}{% include "admin/_category_add.html" %}{% endif %}
  </div>
</div>
{% endblock %}