Added basic search implementation with display components
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
@namespace OpenArchival.Blazor.ArtifactGroupingDisplay
|
||||
@page "/archive/{GroupingIdString}"
|
||||
@using OpenArchival.DataAccess;
|
||||
@using OpenArchival.Blazor.FileViewer
|
||||
@using MudBlazor
|
||||
|
||||
@inject IArtifactGroupingProvider GroupingProvider;
|
||||
@inject NavigationManager NavigationManager;
|
||||
|
||||
@if (_artifactGrouping is not null)
|
||||
{
|
||||
<MudContainer MaxWidth="MaxWidth.Large">
|
||||
<MudPaper Class="pa-4 ma-2 rounded d-flex justify-center" Elevation="3">
|
||||
<MudText Typo="Typo.h3">@_artifactGrouping.Title</MudText>
|
||||
</MudPaper>
|
||||
|
||||
<MudPaper Class="pa-4 ma-2 rounded d-flex justify-center" Elevation="3">
|
||||
@*<MudImage Class="d-flex justify-center" Src="https://dummyimage.com/600x400/000/fff"></MudImage>*@
|
||||
<FileViewerCarousel FilePathListings="_artifactGrouping.ChildFilePathListings" MaxHeight="500" ShowUnsupportedFiles=false></FileViewerCarousel>
|
||||
</MudPaper>
|
||||
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="8">
|
||||
<MudPaper Style="height: 100%;" Class="pa-4 ma-2 rounded" Elevation="3">
|
||||
<MudText Typo="Typo.h6">Description</MudText>
|
||||
<MudDivider></MudDivider>
|
||||
<MudText Typo="Typo.body2">@_artifactGrouping.Description</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<MudPaper Style="height: 100%;" Class="pa-4 ma-2 rounded" Elevation="3">
|
||||
<MudText Typo="Typo.h6">Artifact Identifier</MudText>
|
||||
<MudDivider></MudDivider>
|
||||
<MudText Typo="Typo.caption">@_artifactGrouping.ArtifactGroupingIdentifier</MudText>
|
||||
|
||||
<MudText Typo="Typo.h6">Primary Artifact Category</MudText>
|
||||
<MudDivider></MudDivider>
|
||||
<MudText Typo="Typo.caption">@_artifactGrouping.Category.Name</MudText>
|
||||
|
||||
<MudText Typo="Typo.h6">Primary Artifact Type</MudText>
|
||||
<MudDivider></MudDivider>
|
||||
<MudText Typo="Typo.caption">@_artifactGrouping.Type.Name</MudText>
|
||||
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<MudPaper Class="pa-4 mt-8 ma-2 rounded" Elevation="3">
|
||||
@foreach (ArtifactEntry child in _artifactGrouping.ChildArtifactEntries) {
|
||||
<ArchiveEntryDisplay ArtifactEntry="child"></ArchiveEntryDisplay>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string GroupingIdString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The converted grouping id from the URL
|
||||
/// </summary>
|
||||
private int _groupingId { get; set; }
|
||||
|
||||
private ArtifactGrouping _artifactGrouping { get; set; } = default!;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
_groupingId = int.Parse(GroupingIdString);
|
||||
var grouping = await GroupingProvider.GetGroupingAsync(_groupingId);
|
||||
|
||||
if (grouping is null)
|
||||
{
|
||||
NavigationManager.NavigateTo("/grouping-not-found");
|
||||
}
|
||||
|
||||
_artifactGrouping = grouping!;
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user