52 lines
2.0 KiB
HTML
52 lines
2.0 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_keyword') }}" 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>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for keyword in keywords %}
|
|
<tr>
|
|
<td>{{ keyword.term }}</td>
|
|
<td>{{ keyword.description }}</td>
|
|
<td>{{ keyword.subtopics|length }}</td>
|
|
<td>
|
|
<a href="{{ url_for('main.edit_keyword', keyword_id=keyword.id) }}"
|
|
class="btn btn-sm btn-primary">編輯</a>
|
|
<a href="{{ url_for('main.delete_keyword', keyword_id=keyword.id) }}"
|
|
class="btn btn-sm btn-danger"
|
|
onclick="return confirm('確定要刪除此關鍵字嗎?')">刪除</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|