Skip to main content

max / makenotwork

1.5 KB · 41 lines History Blame Raw
1 {%- import "partials/_ui.html" as ui -%}
2 <div class="section-group-label">Contacts</div>
3
4 <details class="form-section buyer-contacts" open>
5 <summary><h2 class="subsection-title">Shared Contacts ({{ contacts.len() }})</h2></summary>
6 <p class="text-sm muted mb-section">
7 Buyers who opted to share their email at checkout. They can revoke sharing from their library.
8 </p>
9 {% if !contacts.is_empty() %}
10 <div class="mb-section">
11 {{ crate::quasi::export_act::html("/api/export/contacts", "contacts.csv")|safe }}
12 </div>
13 <div class="scroll-x">
14 <table class="data-table contacts-table well">
15 <thead>
16 <tr>
17 <th>Username</th>
18 <th>Email</th>
19 <th>Purchases</th>
20 <th>Total Spent</th>
21 <th>Last Purchase</th>
22 </tr>
23 </thead>
24 <tbody>
25 {% for contact in contacts %}
26 <tr>
27 <td><a href="/u/{{ contact.username }}">{{ contact.username }}</a></td>
28 <td>{{ contact.email }}</td>
29 <td>{{ contact.total_purchases }}</td>
30 <td>{{ contact.total_spent }}</td>
31 <td>{{ contact.last_purchase }}</td>
32 </tr>
33 {% endfor %}
34 </tbody>
35 </table>
36 </div>
37 {% else %}
38 {% call ui::empty_state("", "No shared contacts yet. When buyers opt to share their email at checkout, they will appear here.") %}{% endcall %}
39 {% endif %}
40 </details>
41