Files
photo-pipeline/dashboard/templates/_card.html

26 lines
1.6 KiB
HTML

{% set sha8 = item["sha256"][:8] %}
<div class="card" id="card-{{ sha8 }}">
<label class="check">
<input type="checkbox" class="item-check" value="{{ item["sha256"] }}" data-name="{{ item["name"] }}">
</label>
<a href="/file/{{ item["sha256"] }}" target="_blank">
{% if item["thumb"] %}
<img src="{{ item["thumb"] }}" loading="lazy" alt="">
{% else %}
<div style="aspect-ratio:1;display:flex;align-items:center;justify-content:center;color:#555;font-size:2rem;"></div>
{% endif %}
</a>
<div class="meta">
{{ item["name"] }}<br>
<span class="badge {{ item["status"] }}">{{ item["status"] }}</span>
<span style="color:#666"> · {{ item["source"] }}</span>
{% if item["size_mb"] %}<span style="color:#666"> · {{ item["size_mb"] }}MB</span>{% endif %}
{% if item.get("flag_reason") %}<span style="color:#d43"> · ⚠ {{ item["flag_reason"] }}</span>{% endif %}
</div>
<div class="actions">
<button class="approve" hx-post="/review/{{ item["sha256"] }}/approve" hx-target="#card-{{ sha8 }}" hx-swap="outerHTML" hx-on::after-request="if(event.detail.successful){this.closest('.card').remove();updateCount();showToast('Approved');}">✅ Keep</button>
<button class="reject" hx-post="/review/{{ item["sha256"] }}/reject" hx-target="#card-{{ sha8 }}" hx-swap="outerHTML" hx-on::after-request="if(event.detail.successful){this.closest('.card').remove();updateCount();showToast('Rejected');}">🗑 Reject</button>
<button class="reset" hx-post="/review/{{ item["sha256"] }}/reset" hx-target="#card-{{ sha8 }}" hx-swap="outerHTML"></button>
</div>
</div>