feature: Split summary to separate template

This commit is contained in:
Keith Solomon
2025-02-05 10:43:50 -06:00
parent 75627741ab
commit a9ea8cc9d8
4 changed files with 41 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ jQuery(document).ready(function ($) {
if (selectedTypes.length > 0) appliedFilters.push(`<strong>Type:</strong> ${selectedTypes.join(', ')}`);
if (selectedSubjects.length > 0) appliedFilters.push(`<strong>Subject:</strong> ${selectedSubjects.join(', ')}`);
$('#applied-filters').html(appliedFilters.length ? appliedFilters.join(' | ') : 'None');
$('#applied-filters').html(appliedFilters.length ? appliedFilters.join('<br>') : 'None');
let formData = {
action: 'filter_resources',
@@ -36,7 +36,11 @@ jQuery(document).ready(function ($) {
response = JSON.parse(response);
$('#resource-results').html(response.html);
$('#result-count').text(response.count);
if (response.count !== undefined) {
$('#result-count').text(response.count);
} else {
$('#result-count').text($('#result-count').text()); // Keep initial count
}
});
});
});

View File

@@ -57,9 +57,11 @@
#resource-filter-summary {
display: flex;
gap: .5rem;
justify-content: space-between;
margin-bottom: 1.25rem;
width: 100%;
p { margin: 0; }
p { margin: 0; padding: 0; }
}
#resource-results {