Updated admin page to be more streamlined and added the beginning of the blogging features

This commit is contained in:
Vincent Allen
2025-10-21 13:32:39 -04:00
parent 0e24ce2073
commit b34449808f
224 changed files with 27064 additions and 396 deletions

View File

@@ -41,7 +41,10 @@
</MudExpansionPanel>
@if (_totalResults > 0)
{
<MudText Typo="Typo.subtitle2" Class="my-2">@_totalResults results found</MudText>
<MudGrid Justify="Justify.FlexStart" Class="mt-1 ml-1 mb-2">
<MudText Typo="Typo.subtitle2" Class="my-2">@_totalResults results found</MudText>
<MudButton Class="ml-1" StartIcon="@Icons.Material.Filled.Clear" OnClick="OnClearResults" Variant="Variant.Filled" Color="Color.Primary" Size="Size.Small">Clear</MudButton>
</MudGrid>
}
@if (_artifactGroupings.Count > 0)
{
@@ -57,6 +60,13 @@
<MudPaper Class="d-flex justify-center py-2 mt-4" Elevation="0">
<MudPagination Count="_totalPages" Page="_currentPage" SelectedPageChanged="OnPageChangedAsync" />
</MudPaper>
}
else
{
@foreach (SearchPageSliderEntry entry in _sliderEntries)
{
<SearchPageSlider SliderEntry="entry"></SearchPageSlider>
}
}
@inject IDbContextFactory<ApplicationDbContext> ContextFactory;
@@ -85,6 +95,8 @@
private int _totalResults { get; set; } = 0;
private const int PageSize = 20;
private List<SearchPageSliderEntry> _sliderEntries { get; set; } = [];
// Field to store the current filter logic
private Expression<Func<ArtifactGrouping, bool>> _currentFilterPredicate;
@@ -94,6 +106,9 @@
{
await PerformSearchAsync();
}
await using var context = await ContextFactory.CreateDbContextAsync();
_sliderEntries = await context.SearchPageSliderEntries.Include(e=>e.FilterTags).ToListAsync();
}
private async Task HandleSearchKeyDown(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args)
@@ -155,7 +170,7 @@
{
await LoadPageAsync(page);
}
/// <summary>
/// Fetches a specific page of data from the database using the currently set filter.
/// </summary>
@@ -180,6 +195,13 @@
.Take(PageSize)
.ToListAsync();
StateHasChanged();
}
private void OnClearResults(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
_totalResults = 0;
_artifactGroupings.Clear();
StateHasChanged();
}
}