This commit is contained in:
2026-06-06 09:41:43 -04:00
parent 71b3a8f7b2
commit 903d3b95ff

View File

@@ -45,25 +45,30 @@ function assoc_render_manage_index() {
return $out;
}
// Search and filter bar
// Search and filter bar — single row
$out .= '<div class="assoc-search-bar" role="search">';
$out .= '<div><label class="form-label mb-1" for="assoc-search">Search</label>';
$out .= '<input type="search" id="assoc-search" class="form-control form-control-sm" placeholder="Name or slug…" style="min-width:16rem;"></div>';
$out .= '<div><label class="form-label mb-1" for="assoc-filter-county">County</label>';
$out .= '<select id="assoc-filter-county" class="form-select form-select-sm"><option value="">All counties</option>';
$out .= '<div class="d-flex align-items-center gap-1">';
$out .= '<input type="search" id="assoc-search" class="form-control form-control-sm"
placeholder="Name or slug…" aria-label="Search associations"
style="min-width:14rem;">';
$out .= '</div>';
$out .= '<select id="assoc-filter-county" class="form-select form-select-sm" aria-label="Filter by county" style="max-width:12rem;">';
$out .= '<option value="">All counties</option>';
foreach ($counties as $c => $_) { $out .= '<option value="' . assoc_h($c) . '">' . assoc_h($c) . '</option>'; }
$out .= '</select></div>';
$out .= '</select>';
$out .= '<div><label class="form-label mb-1" for="assoc-filter-type">Type</label>';
$out .= '<select id="assoc-filter-type" class="form-select form-select-sm"><option value="">All types</option>';
$out .= '<select id="assoc-filter-type" class="form-select form-select-sm" aria-label="Filter by type" style="max-width:10rem;">';
$out .= '<option value="">All types</option>';
foreach ($types as $t => $_) { $out .= '<option value="' . assoc_h($t) . '">' . assoc_h($t === 'UNK' ? 'Unknown' : $t) . '</option>'; }
$out .= '</select></div>';
$out .= '</select>';
$out .= '<div><label class="form-label mb-1" for="assoc-filter-status">Standing</label>';
$out .= '<select id="assoc-filter-status" class="form-select form-select-sm"><option value="">All</option>';
$out .= '<select id="assoc-filter-status" class="form-select form-select-sm" aria-label="Filter by standing" style="max-width:9rem;">';
$out .= '<option value="">All standing</option>';
foreach ($statuses as $s => $_) { $out .= '<option value="' . assoc_h($s) . '">' . assoc_h($s === 'UNK' ? 'Unknown' : $s) . '</option>'; }
$out .= '</select></div>';
$out .= '</select>';
$out .= '</div>';
// Bulk bar (hidden until selection)
@@ -86,10 +91,7 @@ function assoc_render_manage_index() {
$out .= '<th scope="col" style="width:2rem;"><input type="checkbox" id="assoc-select-all" class="form-check-input" title="Select all visible"></th>';
$out .= '<th scope="col">Slug</th>';
$out .= '<th scope="col">Legal Name</th>';
$out .= '<th scope="col">Type</th>';
$out .= '<th scope="col">County</th>';
$out .= '<th scope="col">Units</th>';
$out .= '<th scope="col">Standing</th>';
$out .= '<th scope="col">Updated</th>';
$out .= '<th scope="col"></th>';
$out .= '</tr></thead><tbody>';
@@ -103,6 +105,14 @@ function assoc_render_manage_index() {
if ($status === 'Active') $status_class = 'civicinfra-status-active';
if ($status === 'Dissolved') $status_class = 'civicinfra-status-alert';
// Inline status badge — shown only when not Active
$badge = '';
if ($status && $status !== 'Active') {
$badge = ' <span class="civicinfra-status ' . $status_class . '" style="font-size:0.65rem;">'
. assoc_h($status === 'UNK' ? 'Standing UNK' : $status)
. '</span>';
}
$out .= '<tr data-slug="' . assoc_h($slug) . '"'
. ' data-name="' . assoc_h($entry['assoc_legal_name'] ?? '') . '"'
. ' data-county="' . assoc_h($county) . '"'
@@ -110,14 +120,18 @@ function assoc_render_manage_index() {
. ' data-status="' . assoc_h($status) . '">';
$out .= '<td><input type="checkbox" name="assoc_select[]" value="' . assoc_h($slug) . '" class="form-check-input"></td>';
$out .= '<td><code class="civicinfra-record-id">' . assoc_h($slug) . '</code></td>';
$out .= '<td><a href="' . z_root() . '/channel/' . assoc_h($slug) . '"
class="civicinfra-channel-label text-decoration-none"
title="View channel">'
. '<code class="civicinfra-record-id">' . assoc_h($slug) . '</code>'
. '</a>' . $badge . '</td>';
$out .= '<td>' . assoc_h($entry['assoc_legal_name'] ?? '—') . '</td>';
$out .= '<td>' . assoc_h($type ?: '—') . '</td>';
$out .= '<td>' . assoc_h($county ?: '—') . '</td>';
$out .= '<td>' . assoc_h($entry['assoc_units'] ?? '—') . '</td>';
$out .= '<td><span class="civicinfra-status ' . $status_class . '">' . assoc_h($status ?: 'UNK') . '</span></td>';
$out .= '<td class="civicinfra-record-meta">' . assoc_h($entry['assoc_units'] ?? '—') . '</td>';
$out .= '<td class="civicinfra-record-meta">' . assoc_h($entry['assoc_updated'] ?? '—') . '</td>';
$out .= '<td><a href="' . z_root() . '/assoc_profile/manage/assoc/' . assoc_h($slug) . '" class="btn btn-sm btn-outline-primary">Edit</a></td>';
$out .= '<td><a href="' . z_root() . '/assoc_profile/manage/assoc/' . assoc_h($slug) . '"
class="btn btn-sm btn-outline-secondary">Edit</a></td>';
$out .= '</tr>';
}