Search UI complete (#3)

"Back" doesn't preserve search results; need to fix that before this is done
This commit is contained in:
Daniel J. Summers 2021-01-18 14:52:24 -05:00
parent 7839b8eb57
commit feb3c5fd4a
5 changed files with 51 additions and 8 deletions

View File

@ -14,9 +14,9 @@
{ {
if (!Searched) if (!Searched)
{ {
<p>Instructions go here</p> <p>Enter one or more criteria to filter results, or just click &ldquo;Search&rdquo; to list all profiles.</p>
} }
<section> <Collapsible HeaderText="Search Criteria" Collapsed=@(Searched && SearchResults.Any())>
<EditForm Model=@Criteria OnValidSubmit=@RetrieveProfiles> <EditForm Model=@Criteria OnValidSubmit=@RetrieveProfiles>
<div class="form-row"> <div class="form-row">
<div class="col col-12 col-sm-6 col-md-4 col-lg-3"> <div class="col col-12 col-sm-6 col-md-4 col-lg-3">
@ -64,7 +64,8 @@
</div> </div>
</div> </div>
</EditForm> </EditForm>
</section> </Collapsible>
<br>
@if (SearchResults.Any()) @if (SearchResults.Any())
{ {
<table class="table table-sm table-hover"> <table class="table table-sm table-hover">
@ -93,5 +94,9 @@
</tbody> </tbody>
</table> </table>
} }
else if (Searched)
{
<p>No results found for the specified criteria</p>
}
} }
</ErrorList> </ErrorList>

View File

@ -54,9 +54,6 @@ namespace JobsJobsJobs.Client.Pages.Profile
{ {
ErrorMessages.Add(continentResult.Error); ErrorMessages.Add(continentResult.Error);
} }
// TODO: remove this call once the filter is ready
await RetrieveProfiles();
} }
/// <summary> /// <summary>

View File

@ -0,0 +1,25 @@
<div class="card">
<div class="card-header">
<a href="#" class="@(Collapsed ? "jjj-c-collapsed" : "jjj-c-open")"
@onclick=@Toggle @onclick:preventDefault>
@HeaderText
</a>
</div>
@if (!Collapsed)
{
<div class="card-body">@ChildContent</div>
}
</div>
@code {
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
[Parameter]
public bool Collapsed { get; set; } = false;
[Parameter]
public string HeaderText { get; set; } = "Toggle";
private void Toggle() => Collapsed = !Collapsed;
}

View File

@ -0,0 +1,16 @@
a.jjj-c-collapsed,
a.jjj-c-open {
text-decoration: none;
font-weight: bold;
color: black;
}
a.jjj-c-collapsed:hover,
a.jjj-c-open:hover {
cursor: pointer;
}
.jjj-c-collapsed::before {
content: '\2b9e \00a0';
}
.jjj-c-open::before {
content: '\2b9f \00a0';
}

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyVersion>0.7.2.0</AssemblyVersion> <AssemblyVersion>0.8.0.0</AssemblyVersion>
<FileVersion>0.7.2.0</FileVersion> <FileVersion>0.8.0.0</FileVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>