Files
LocalNav/templates/admin_groups.html
T
2026-05-12 15:25:03 +08:00

70 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 style="width: 200px">操作</th>
</tr>
</thead>
<tbody>
{% for g in groups %}
<tr>
<td>{{ g.id }}</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="4" class="hint">暂无分组,点击「新建分组」</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}