Blockchain_KM/app/templates/admin/sections.html
2024-12-02 01:18:08 +08:00

50 lines
1.8 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container mt-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2>區塊管理</h2>
<a href="{{ url_for('main.add_section') }}" class="btn btn-primary">新增區塊</a>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>順序</th>
<th>標題</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for section in sections %}
<tr>
<td>{{ section.order_num }}</td>
<td>{{ section.title }}</td>
<td>
<a href="{{ url_for('main.edit_section', section_id=section.id) }}"
class="btn btn-sm btn-primary">編輯</a>
<a href="{{ url_for('main.delete_section', section_id=section.id) }}"
class="btn btn-sm btn-danger"
onclick="return confirm('確定要刪除此區塊嗎?')">刪除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}