AIDaohang/templates/edit_main_category.html
2025-07-05 22:41:21 +08:00

40 lines
1.8 KiB
HTML

{% extends "base.html" %}
{% block title %}编辑主分类{% endblock %}
{% block content %}
<div class="card">
<div class="card-header">
<h4>编辑主分类</h4>
</div>
<div class="card-body">
<form method="post">
<div class="mb-3">
<label for="main_id" class="form-label">分类ID</label>
<input type="text" class="form-control" id="main_id" value="{{ main_id }}" disabled>
</div>
<div class="mb-3">
<label for="name" class="form-label">分类名称</label>
<input type="text" class="form-control" id="name" name="name" value="{{ category.name }}" required>
</div>
<div class="mb-3">
<label for="color" class="form-label">颜色</label>
<input type="color" name="color" id="color" class="form-control form-control-color"
value="{{ category.color }}" title="选择颜色">
</div>
<div class="mb-3">
<label for="weight" class="form-label">权重</label>
<input type="number" class="form-control" id="weight" name="weight" value="{{ category.get('weight', 0) }}">
<small class="text-muted">权重越大,排序越靠前</small>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="private" name="private"
{% if category.get('private', False) %}checked{% endif %}>
<label class="form-check-label" for="private">私有分类</label>
</div>
<button type="submit" class="btn btn-primary">保存</button>
<a href="{{ url_for('manage_categories') }}" class="btn btn-secondary">取消</a>
</form>
</div>
</div>
{% endblock %}