feat(dashboard): show each pet's icon and kind when moderating pet names

The pet name tables (Pet Names page and the review queue) get the pet's
LOT from its owner's save and its CDClient name, shown with the icon in
a new Pet column. Each owner on the page is read once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 00:38:34 -05:00
parent c715911c2e
commit 377f812e07
5 changed files with 44 additions and 5 deletions

View File

@@ -24,7 +24,7 @@
<div class="card-header"><h5 class="mb-0">Pending Pet Names</h5></div>
<div class="card-body">
<table id="pendingPetsTable" class="table table-striped table-hover table-stack">
<thead><tr><th>ID</th><th>Pet Name</th><th>Owner</th><th>Actions</th></tr></thead>
<thead><tr><th>ID</th><th>Pet</th><th>Pet Name</th><th>Owner</th><th>Actions</th></tr></thead>
<tbody></tbody>
</table>
</div>
@@ -78,6 +78,7 @@ $(function () {
if (DASH.can('moderate_pet_names')) {
serverTable('#pendingPetsTable', '/api/tables/pending_pet_names', [
{ data: 'id', orderable: false },
{ data: 'lot', orderable: false, render: function (d, t, row) { return fmt.pet(row.lot, row.kind); } },
{ data: 'pet_name', orderable: false },
{ data: 'owner_id', orderable: false, defaultContent: '', render: petOwner },
{ data: 'id', orderable: false, render: function (d, t, row) { return actionButtons('pet', d, row.owner_id, row.pet_name); } }

View File

@@ -18,6 +18,7 @@
<thead>
<tr>
<th>ID</th>
<th>Pet</th>
<th>Pet Name</th>
<th>Status</th>
<th>Owner</th>
@@ -36,6 +37,7 @@ $(function () {
var pending = document.getElementById('pendingOnly');
var table = serverTable('#petNamesTable', '/api/tables/pet_names', [
{ data: 'id' },
{ data: 'lot', orderable: false, render: function (d, t, row) { return fmt.pet(row.lot, row.kind); } },
{ data: 'pet_name' },
// 1 = pending moderation, 2 = approved (rejected names are deleted)
{ data: 'approved', render: function (d) { return d === 2 ? fmt.badge('Approved', 'success') : fmt.badge('Pending', 'warning'); } },