39 lines
1.7 KiB
HTML
39 lines
1.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="mb-0">{% if keyword is defined %}編輯關鍵字{% else %}新增關鍵字{% endif %}</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
{% 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 %}
|
|
|
|
<form method="POST">
|
|
<div class="mb-3">
|
|
<label for="term" class="form-label">關鍵字</label>
|
|
<input type="text" class="form-control" id="term" name="term"
|
|
value="{{ keyword.term if keyword is defined else '' }}" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="description" class="form-label">解釋</label>
|
|
<textarea class="form-control" id="description" name="description" rows="3" required>{{ keyword.description if keyword is defined else '' }}</textarea>
|
|
</div>
|
|
<div class="mt-4">
|
|
<button type="submit" class="btn btn-primary">
|
|
{% if keyword is defined %}保存{% else %}新增{% endif %}
|
|
</button>
|
|
<a href="{{ url_for('main.manage_keywords') }}" class="btn btn-secondary">返回</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|