mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-27 23:17:14 +00:00
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:
@@ -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); } }
|
||||
|
||||
@@ -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'); } },
|
||||
|
||||
Reference in New Issue
Block a user