fixed rolodex page
This commit is contained in:
@@ -48,60 +48,74 @@
|
||||
{ 'title': 'Phones', 'width': '200px' },
|
||||
{ 'title': 'Actions', 'width': '140px', 'align': 'end' },
|
||||
] %}
|
||||
{% call(answer_table(headers, form_action='/reports/phone-book', select_name='client_ids', enable_bulk=enable_bulk)) %}
|
||||
{% if clients and clients|length > 0 %}
|
||||
<form method="post" action="/reports/phone-book" class="js-answer-table">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
{% if enable_bulk %}
|
||||
<th style="width: 40px;"><input class="form-check-input js-select-all" type="checkbox"></th>
|
||||
{% endif %}
|
||||
{% for h in headers %}
|
||||
<th{% if h.width %} style="width: {{ h.width }};"{% endif %}{% if h.align == 'end' %} class="text-end"{% endif %}>{{ h.title }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if clients and clients|length > 0 %}
|
||||
{% for c in clients %}
|
||||
<tr>
|
||||
{% if enable_bulk %}
|
||||
<td><input class="form-check-input" type="checkbox" name="client_ids" value="{{ c.id }}"></td>
|
||||
{% if enable_bulk %}
|
||||
<td><input class="form-check-input" type="checkbox" name="client_ids" value="{{ c.id }}"></td>
|
||||
{% endif %}
|
||||
<td><span class="fw-semibold">{{ c.last_name or '' }}, {{ c.first_name or '' }}</span></td>
|
||||
<td>{{ c.company or '' }}</td>
|
||||
<td>{{ c.address or '' }}</td>
|
||||
<td>{{ c.city or '' }}</td>
|
||||
<td>{{ c.state or '' }}</td>
|
||||
<td>{{ c.zip_code or '' }}</td>
|
||||
<td>
|
||||
{% if c.phones and c.phones|length > 0 %}
|
||||
{% for p in c.phones[:3] %}
|
||||
<span class="badge bg-light text-dark me-1">{{ p.phone_number }}</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
<td><span class="fw-semibold">{{ c.last_name or '' }}, {{ c.first_name or '' }}</span></td>
|
||||
<td>{{ c.company or '' }}</td>
|
||||
<td>{{ c.address or '' }}</td>
|
||||
<td>{{ c.city or '' }}</td>
|
||||
<td>{{ c.state or '' }}</td>
|
||||
<td>{{ c.zip_code or '' }}</td>
|
||||
<td>
|
||||
{% if c.phones and c.phones|length > 0 %}
|
||||
{% for p in c.phones[:3] %}
|
||||
<span class="badge bg-light text-dark me-1">{{ p.phone_number }}</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" href="/rolodex/{{ c.id }}">
|
||||
<i class="bi bi-person-lines-fill me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" href="/rolodex/{{ c.id }}">
|
||||
<i class="bi bi-person-lines-fill me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="8" class="text-center text-muted py-4">No clients found.</td>
|
||||
<td colspan="8" class="text-center text-muted py-4">No clients found.</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{% if enable_bulk %}
|
||||
{% call(bulk_actions_bar()) %}
|
||||
<button type="submit" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-journal-text me-1"></i>Phone Book (Selected)
|
||||
</button>
|
||||
<a class="btn btn-outline-secondary" href="/reports/phone-book?format=csv{% if q %}&q={{ q | urlencode }}{% endif %}">
|
||||
<i class="bi bi-filetype-csv me-1"></i>Phone Book CSV (Current Filter)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/phone-book-address" href="#">
|
||||
<i class="bi bi-journal-text me-1"></i>Phone+Address (Selected)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/envelope" href="#">
|
||||
<i class="bi bi-envelope me-1"></i>Envelope (Selected)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/rolodex-info" href="#">
|
||||
<i class="bi bi-card-text me-1"></i>Rolodex Info (Selected)
|
||||
</a>
|
||||
{% endcall %}
|
||||
<div class="d-flex gap-2 mb-2">
|
||||
<button type="submit" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-journal-text me-1"></i>Phone Book (Selected)
|
||||
</button>
|
||||
<a class="btn btn-outline-secondary" href="/reports/phone-book?format=csv{% if q %}&q={{ q | urlencode }}{% endif %}">
|
||||
<i class="bi bi-filetype-csv me-1"></i>Phone Book CSV (Current Filter)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/phone-book-address" href="#">
|
||||
<i class="bi bi-journal-text me-1"></i>Phone+Address (Selected)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/envelope" href="#">
|
||||
<i class="bi bi-envelope me-1"></i>Envelope (Selected)
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary js-submit-to" data-action="/reports/rolodex-info" href="#">
|
||||
<i class="bi bi-card-text me-1"></i>Rolodex Info (Selected)
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user