Rolodex UX: add /rolodex/{id}/edit route, prefill support for new form, fix edit links, and improve empty state guidance. Also fix header width lints in template.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
<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>
|
||||
<th{% if h.width %} width="{{ h.width | replace('px', '') }}"{% endif %}{% if h.align == 'end' %} class="text-end"{% endif %}>{{ h.title }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -91,7 +91,12 @@
|
||||
{% endfor %}
|
||||
{% 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.
|
||||
<div class="small mt-1">
|
||||
If you've imported legacy data, go to <a href="/admin">Admin</a> and run <em>Sync to Modern Models</em> to populate Clients and Phones.
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
@@ -11,12 +11,9 @@
|
||||
</a>
|
||||
<h2 class="mb-0">Client</h2>
|
||||
<div class="ms-auto">
|
||||
<a class="btn btn-sm btn-outline-primary" href="/rolodex/{{ client.id }}/edit" onclick="event.preventDefault(); document.getElementById('editFormLink').submit();">
|
||||
<a class="btn btn-sm btn-outline-primary" href="/rolodex/{{ client.id }}/edit">
|
||||
<i class="bi bi-pencil-square me-1"></i>Edit
|
||||
</a>
|
||||
<form id="editFormLink" method="get" action="/rolodex/new" class="d-none">
|
||||
<input type="hidden" name="_" value="1">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,12 +54,9 @@
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-primary" href="/rolodex/new" onclick="event.preventDefault(); document.getElementById('editClientForm').submit();">
|
||||
<a class="btn btn-primary" href="/rolodex/{{ client.id }}/edit">
|
||||
<i class="bi bi-pencil-square me-1"></i>Edit Client
|
||||
</a>
|
||||
<form id="editClientForm" method="get" action="/rolodex/new" class="d-none">
|
||||
<input type="hidden" name="_prefill" value="{{ client.id }}">
|
||||
</form>
|
||||
<form method="post" action="/rolodex/{{ client.id }}/delete" onsubmit="return confirm('Delete this client? This cannot be undone.');">
|
||||
<button type="submit" class="btn btn-outline-danger">
|
||||
<i class="bi bi-trash me-1"></i>Delete
|
||||
|
||||
Reference in New Issue
Block a user