feat: request lists page with deal and buyer group filters
Add deal filter and buyer group filter dropdowns to request lists page. Client-side filtering hides/shows deal sections and group subsections. Organized by deal name as section header with per-group subsections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cc9e7eeff1
commit
cdca770e45
|
|
@ -25,14 +25,27 @@ type RequestsByGroup struct {
|
|||
templ RequestListPage(profile *model.Profile, deals []*model.Deal, dealRequests map[string][]*RequestsByGroup) {
|
||||
@Layout(profile, "requests") {
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Request Lists</h1>
|
||||
<p class="text-sm text-gray-500 mt-1">Diligence request tracking across all deals.</p>
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Request Lists</h1>
|
||||
<p class="text-sm text-gray-500 mt-1">Diligence request tracking across all deals.</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<select id="dealFilter" onchange="filterRequests()" class="px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-sm text-gray-100 focus:border-teal-500 focus:outline-none">
|
||||
<option value="">All Deals</option>
|
||||
for _, deal := range deals {
|
||||
<option value={ deal.ID }>{ deal.Name }</option>
|
||||
}
|
||||
</select>
|
||||
<select id="groupFilter" onchange="filterRequests()" class="px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-sm text-gray-100 focus:border-teal-500 focus:outline-none">
|
||||
<option value="">All Groups</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
for _, deal := range deals {
|
||||
if groups, ok := dealRequests[deal.ID]; ok && len(groups) > 0 {
|
||||
<div class="bg-gray-900 rounded-lg border border-gray-800">
|
||||
<div class="bg-gray-900 rounded-lg border border-gray-800 deal-section" data-deal-id={ deal.ID }>
|
||||
<div class="p-4 border-b border-gray-800">
|
||||
<div class="flex items-center gap-2">
|
||||
<h2 class="text-sm font-semibold">{ deal.Name }</h2>
|
||||
|
|
@ -42,7 +55,7 @@ templ RequestListPage(profile *model.Profile, deals []*model.Deal, dealRequests
|
|||
</div>
|
||||
|
||||
for _, group := range groups {
|
||||
<div class="border-b border-gray-800 last:border-b-0">
|
||||
<div class="border-b border-gray-800 last:border-b-0 group-section" data-group={ group.Name }>
|
||||
<div class="px-4 py-2 bg-gray-800/30">
|
||||
<span class="text-xs font-medium text-teal-400">{ group.Name }</span>
|
||||
<span class="text-xs text-gray-500 ml-2">{ fmt.Sprintf("%d items", len(group.Requests)) }</span>
|
||||
|
|
@ -102,6 +115,22 @@ templ RequestListPage(profile *model.Profile, deals []*model.Deal, dealRequests
|
|||
</div>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
function filterRequests() {
|
||||
var dealId = document.getElementById('dealFilter').value;
|
||||
var group = document.getElementById('groupFilter').value;
|
||||
document.querySelectorAll('.deal-section').forEach(function(el) {
|
||||
var show = !dealId || el.getAttribute('data-deal-id') === dealId;
|
||||
el.style.display = show ? '' : 'none';
|
||||
if (show) {
|
||||
el.querySelectorAll('.group-section').forEach(function(gs) {
|
||||
var gShow = !group || gs.getAttribute('data-group') === group;
|
||||
gs.style.display = gShow ? '' : 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue