41 lines
1.8 KiB
HTML
41 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="mb-0">{% if section 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="title" class="form-label">區塊標題</label>
|
|
<input type="text" class="form-control" id="title" name="title"
|
|
value="{{ section.title if section is defined else '' }}" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="order_num" class="form-label">順序</label>
|
|
<input type="number" class="form-control" id="order_num" name="order_num"
|
|
value="{{ section.order_num if section is defined else '' }}" required>
|
|
<div class="form-text">數字越小排序越前面</div>
|
|
</div>
|
|
<div class="mt-4">
|
|
<button type="submit" class="btn btn-primary">
|
|
{% if section is defined %}保存{% else %}新增{% endif %}
|
|
</button>
|
|
<a href="{{ url_for('main.manage_sections') }}" class="btn btn-secondary">返回</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|