50 lines
2.2 KiB
HTML
50 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ profile.nickname }} - Postcard Manager{% endblock %}
|
|
{% block content %}
|
|
<div class="section-header">
|
|
<h1>{{ profile.nickname }} 的明信片</h1>
|
|
<a href="/profiles/{{ profile.id }}/postcards/new" class="btn btn-primary">+ 新明信片</a>
|
|
</div>
|
|
<div class="filter-bar">
|
|
<form method="get" class="form-row">
|
|
<select name="status">
|
|
<option value="">全部状态</option>
|
|
<option value="sent" {% if status == 'sent' %}selected{% endif %}>已寄出</option>
|
|
<option value="delivered" {% if status == 'delivered' %}selected{% endif %}>已送达</option>
|
|
<option value="received" {% if status == 'received' %}selected{% endif %}>已收到</option>
|
|
</select>
|
|
<input type="text" name="country" placeholder="国家/地区" value="{{ country }}">
|
|
<button type="submit" class="btn">筛选</button>
|
|
</form>
|
|
</div>
|
|
{% if postcards %}
|
|
<div class="card-grid">
|
|
{% for pc in postcards %}
|
|
<a href="/postcards/{{ pc.id }}" class="postcard-card">
|
|
{% if pc.image_front %}
|
|
<img src="{{ pc.image_front }}" alt="正面" class="thumb">
|
|
{% else %}
|
|
<div class="thumb placeholder">📷</div>
|
|
{% endif %}
|
|
<div class="postcard-info">
|
|
<span class="badge badge-{{ pc.status }}">{{ {'sent':'已寄出','delivered':'已送达','received':'已收到'}.get(pc.status, pc.status) }}</span>
|
|
<strong>{{ pc.card_number }}</strong>
|
|
{% if pc.status in ('sent','delivered') %}
|
|
<span>→ {{ pc.recipient_name or '-' }} ({{ pc.country|flag }} {{ pc.country or '-' }})</span>
|
|
{% else %}
|
|
<span>← {{ pc.sender_name or '-' }}</span>
|
|
{% endif %}
|
|
{% if pc.status == 'sent' %}
|
|
<form method="post" action="/postcards/{{ pc.id }}/mark-delivered" class="inline" onclick="event.stopPropagation();">
|
|
<button type="submit" class="btn btn-sm btn-primary" onclick="return confirm('确认已送达?')">✓ 标记已送达</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p class="empty">没有找到明信片。</p>
|
|
{% endif %}
|
|
{% endblock %}
|