| 1 |
{% if !buyer_contacts.is_empty() %} |
| 2 |
<div class="content-section"> |
| 3 |
<h2 class="subsection-title">Your Buyers ({{ total_buyer_contacts }})</h2> |
| 4 |
<p class="section-lead text-sm">Buyers who opted to share their email with you at purchase time.</p> |
| 5 |
<div class="scroll-x"> |
| 6 |
<table class="data-table minw-500"> |
| 7 |
<thead> |
| 8 |
<tr> |
| 9 |
<th>Username</th> |
| 10 |
<th>Email</th> |
| 11 |
<th>Purchases</th> |
| 12 |
<th>Total Spent</th> |
| 13 |
<th>Last Purchase</th> |
| 14 |
</tr> |
| 15 |
</thead> |
| 16 |
<tbody> |
| 17 |
{% for c in buyer_contacts %} |
| 18 |
<tr> |
| 19 |
<td><a href="/u/{{ c.username }}">{{ c.username }}</a></td> |
| 20 |
<td><a href="mailto:{{ c.email }}">{{ c.email }}</a></td> |
| 21 |
<td>{{ c.total_purchases }}</td> |
| 22 |
<td>{{ c.total_spent }}</td> |
| 23 |
<td>{{ c.last_purchase }}</td> |
| 24 |
</tr> |
| 25 |
{% endfor %} |
| 26 |
</tbody> |
| 27 |
</table> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
{% endif %} |
| 31 |
|
| 32 |
{% if shared_creators.is_empty() && buyer_contacts.is_empty() %} |
| 33 |
<div class="content-section"> |
| 34 |
<p class="muted">No contacts yet.</p> |
| 35 |
</div> |
| 36 |
{% endif %} |
| 37 |
|
| 38 |
{% if !shared_creators.is_empty() %} |
| 39 |
<div class="content-section"> |
| 40 |
<h2 class="subsection-title">Shared With</h2> |
| 41 |
<p class="section-lead text-sm">You've shared your email with these creators. You can revoke sharing at any time.</p> |
| 42 |
<div class="scroll-x"> |
| 43 |
<table class="data-table minw-300"> |
| 44 |
<thead> |
| 45 |
<tr> |
| 46 |
<th>Creator</th> |
| 47 |
<th></th> |
| 48 |
</tr> |
| 49 |
</thead> |
| 50 |
<tbody> |
| 51 |
{% for creator in shared_creators %} |
| 52 |
<tr id="shared-contact-{{ creator.seller_id }}"> |
| 53 |
<td> |
| 54 |
<a href="/u/{{ creator.username }}"> |
| 55 |
{% if let Some(dn) = creator.display_name %}{{ dn }}{% else %}{{ creator.username }}{% endif %} |
| 56 |
</a> |
| 57 |
</td> |
| 58 |
<td class="text-right"> |
| 59 |
<button class="btn-small btn-danger" |
| 60 |
hx-delete="/api/contacts/{{ creator.seller_id }}" |
| 61 |
hx-target="#shared-contact-{{ creator.seller_id }}" |
| 62 |
hx-swap="outerHTML" |
| 63 |
hx-confirm="Revoke contact sharing with {{ creator.username }}?"> |
| 64 |
Revoke |
| 65 |
</button> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
{% endfor %} |
| 69 |
</tbody> |
| 70 |
</table> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
{% endif %} |
| 74 |
|