You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
10 KiB
186 lines
10 KiB
{% extends "base.html" %}
|
|
|
|
{% block title %}编辑信息{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="w-full">
|
|
<section class="mb-4 flex items-start justify-between gap-3 sm:mb-5">
|
|
<div>
|
|
<div class="flex items-center gap-2">
|
|
<h2 class="page-title">编辑信息</h2>
|
|
<span class="rounded-full bg-brand-100 px-3 py-1 text-xs font-medium text-brand-700 dark:bg-brand-500/15 dark:text-brand-200">分享链接</span>
|
|
</div>
|
|
</div>
|
|
<a class="btn btn-secondary shrink-0" href="{{ url_for('share.search_page', token=token, q=search_term) if search_term else url_for('share.search_page', token=token) }}">返回搜索</a>
|
|
</section>
|
|
|
|
<section class="mb-4 rounded-2xl border border-neutral-200 bg-white px-4 py-3 text-sm text-neutral-700 shadow-soft dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200 sm:mb-5">
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<span class="status-badge status-badge-muted">{{ household.head_name }}</span>
|
|
<span class="text-neutral-500 dark:text-neutral-400">{{ household_value_label('side', household.side) }}{% if household.phone %} · {{ household.phone }}{% endif %}</span>
|
|
<span class="status-badge status-badge-muted">户编码 {{ household.household_code }}</span>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<div class="card-body">
|
|
<form action="{{ url_for('share.update_household', token=token, household_id=household.id) }}" method="post" class="space-y-4">
|
|
<input type="hidden" name="version" value="{{ household.version }}">
|
|
<input type="hidden" name="q" value="{{ search_term }}">
|
|
<input type="hidden" name="household_code" value="{{ household.household_code }}">
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label for="head_name" class="form-label">户主姓名</label>
|
|
<input class="form-input" id="head_name" name="head_name" type="text" value="{{ household.head_name }}">
|
|
</div>
|
|
<div>
|
|
<label for="side" class="form-label">所属侧</label>
|
|
<select class="form-select" id="side" name="side">
|
|
{% for value, label in [('groom_side', '男方'), ('bride_side', '女方'), ('both_side', '双方共有')] %}
|
|
<option value="{{ value }}" {% if household.side == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label for="relation_category_option_id" class="form-label">关系分类</label>
|
|
<select class="form-select" id="relation_category_option_id" name="relation_category_option_id">
|
|
<option value="">未选择</option>
|
|
{% for option in relation_category_options %}
|
|
<option value="{{ option.id }}" {% if household.relation_category_option_id == option.id %}selected{% endif %}>{{ option.option_label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="mb-2 block text-sm font-medium text-neutral-700 dark:text-neutral-200">标签</label>
|
|
<div class="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
|
{% set selected_tag_ids = household.tag_option_ids_json or [] %}
|
|
{% for option in tag_options %}
|
|
<label class="flex items-center gap-3 rounded-xl border border-neutral-200 bg-white px-3 py-2 text-sm text-neutral-700 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200">
|
|
<input type="checkbox" name="tag_option_ids_json" value="{{ option.id }}" {% if option.id in selected_tag_ids %}checked{% endif %} class="h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 dark:border-neutral-600 dark:bg-neutral-800 dark:text-brand-400">
|
|
<span>{{ option.option_label }}</span>
|
|
</label>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label for="invite_status" class="form-label">邀请状态</label>
|
|
<select class="form-select" id="invite_status" name="invite_status">
|
|
{% for value, label in [('not_invited', '未邀请'), ('invited', '已邀请'), ('confirmed', '已确认'), ('declined', '已婉拒')] %}
|
|
<option value="{{ value }}" {% if household.invite_status == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="expected_attendee_count" class="form-label">预计人数</label>
|
|
<input class="form-input" id="expected_attendee_count" name="expected_attendee_count" type="number" min="0" value="{{ household.expected_attendee_count }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label for="attendance_status" class="form-label">到场状态</label>
|
|
<select class="form-select" id="attendance_status" name="attendance_status">
|
|
{% for value, label in [('pending', '待确认'), ('attending', '到场'), ('absent', '缺席'), ('partial', '部分到场')] %}
|
|
<option value="{{ value }}" {% if household.attendance_status == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="actual_attendee_count" class="form-label">实际到场人数</label>
|
|
<input class="form-input" id="actual_attendee_count" name="actual_attendee_count" type="number" min="0" value="{{ household.actual_attendee_count }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
<div>
|
|
<label for="child_count" class="form-label">儿童人数</label>
|
|
<input class="form-input" id="child_count" name="child_count" type="number" min="0" value="{{ household.child_count }}">
|
|
</div>
|
|
<div>
|
|
<label for="red_packet_child_count" class="form-label">需红包儿童</label>
|
|
<input class="form-input" id="red_packet_child_count" name="red_packet_child_count" type="number" min="0" value="{{ household.red_packet_child_count }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
<div>
|
|
<label for="total_gift_amount" class="form-label">礼金金额</label>
|
|
<input class="form-input" id="total_gift_amount" name="total_gift_amount" type="number" min="0" step="0.01" value="{{ '%.2f'|format(household.total_gift_amount) }}">
|
|
</div>
|
|
<div>
|
|
<label for="gift_method_option_id" class="form-label">礼金方式</label>
|
|
<select class="form-select" id="gift_method_option_id" name="gift_method_option_id">
|
|
<option value="">未选择</option>
|
|
{% for option in gift_method_options %}
|
|
<option value="{{ option.id }}" {% if household.gift_method_option_id == option.id %}selected{% endif %}>{{ option.option_label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="gift_scene_option_id" class="form-label">记录场景</label>
|
|
<select class="form-select" id="gift_scene_option_id" name="gift_scene_option_id">
|
|
<option value="">未选择</option>
|
|
{% for option in gift_scene_options %}
|
|
<option value="{{ option.id }}" {% if household.gift_scene_option_id == option.id %}selected{% endif %}>{{ option.option_label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
<div>
|
|
<label for="favor_status" class="form-label">伴手礼状态</label>
|
|
<select class="form-select" id="favor_status" name="favor_status">
|
|
{% for value, label in [('not_given', '未发'), ('given', '已发')] %}
|
|
<option value="{{ value }}" {% if household.favor_status == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="candy_status" class="form-label">喜糖状态</label>
|
|
<select class="form-select" id="candy_status" name="candy_status">
|
|
{% for value, label in [('not_given', '未发'), ('given', '已发')] %}
|
|
<option value="{{ value }}" {% if household.candy_status == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="child_red_packet_status" class="form-label">儿童红包状态</label>
|
|
<select class="form-select" id="child_red_packet_status" name="child_red_packet_status">
|
|
{% for value, label in [('not_given', '未发'), ('partial', '部分发放'), ('given', '已发')] %}
|
|
<option value="{{ value }}" {% if household.child_red_packet_status == value %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div>
|
|
<label for="phone" class="form-label">联系电话</label>
|
|
<input class="form-input" id="phone" name="phone" type="text" value="{{ household.phone or '' }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="note" class="form-label">备注</label>
|
|
<textarea class="form-textarea" id="note" name="note" rows="3">{{ household.note or '' }}</textarea>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap items-center gap-3 pt-2">
|
|
<button type="submit" class="btn btn-primary flex-1 sm:flex-none">保存并返回搜索</button>
|
|
<a class="btn btn-secondary flex-1 sm:flex-none" href="{{ url_for('share.search_page', token=token, q=search_term) if search_term else url_for('share.search_page', token=token) }}">取消</a>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
{% endblock %}
|
|
|