Files
LocalNav/templates/admin_groups.html
T
dekun f7ce6f1058 feat: 侧边栏分组图标与导航样式优化
- 分组支持 icon 字段,可按名称自动匹配或手动选择
- 左侧导航与总览卡片显示彩色 SVG 图标
- 优化侧栏链接圆角与选中态样式

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 18:06:42 +08:00

72 lines
2.1 KiB
HTML

{% extends "base.html" %}
{% block title %}分组管理 · 本地导航{% endblock %}
{% block body %}
<header class="topbar">
<h1>分组管理</h1>
<nav>
<a href="{{ url_for('index') }}">返回导航</a>
<a href="{{ url_for('admin_services') }}">服务管理</a>
<a href="{{ url_for('logout') }}">退出</a>
</nav>
</header>
<div class="page-wrap">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="flash-wrap">
{% for cat, msg in messages %}
<div class="flash {{ cat }}">{{ msg }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<div class="toolbar">
<h1 style="margin: 0; flex: 1">自定义分组</h1>
<a class="btn btn-primary" href="{{ url_for('admin_group_new') }}" style="width: auto">新建分组</a>
</div>
<div class="table-wrap">
<table class="data">
<thead>
<tr>
<th>ID</th>
<th>图标</th>
<th>名称</th>
<th>排序</th>
<th style="width: 200px">操作</th>
</tr>
</thead>
<tbody>
{% for g in groups %}
<tr>
<td>{{ g.id }}</td>
<td><code>{{ g.resolve_icon_key() }}</code></td>
<td>{{ g.name }}</td>
<td>{{ g.sort_order }}</td>
<td>
<a href="{{ url_for('admin_group_edit', gid=g.id) }}">编辑</a>
·
<a href="{{ url_for('admin_service_new', group_id=g.id) }}">在此分组添加服务</a>
·
<form
class="inline-form"
method="post"
action="{{ url_for('admin_group_delete', gid=g.id) }}"
onsubmit="return confirm('确定删除该分组?其下所有服务也会被删除。');"
>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<button type="submit" class="btn btn-danger">删除</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="5" class="hint">暂无分组,点击「新建分组」</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}