Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LearningHub.Nhs.WebUI/Views/Catalogue/AllCatalogue.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="nhsuk-grid-row">
<div id="searchTab" class="search-page">
<div class="nhsuk-grid-column-two-thirds">
@await Html.PartialAsync("_AllCatalogueSearchBar", Model)
@await Html.PartialAsync("_AllCatalogueSearchBar", string.Empty)
</div>
</div>

Expand Down
37 changes: 28 additions & 9 deletions LearningHub.Nhs.WebUI/Views/Catalogue/AllCatalogueSearch.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,31 @@

@section styles {
<link rel="stylesheet" type="text/css" href="~/css/nhsuk/pages/catalogue.css" asp-append-version="true" />
<link rel="stylesheet" type="text/css" href="~/css/nhsuk/pages/search.css" asp-append-version="true" />
}

<div class="nhsuk-width-container app-width-container" style="width:100%">
@if (hasSearchTerm)
{
var parms = new Dictionary<string, string> { { "term", searchTerm } };
<vc:back-link asp-controller="Catalogue" asp-action="GetAllCatalogue" link-text="Back to A-Z of catalogues" />
}
else
{
<vc:back-link asp-controller="Home" asp-action="Index" link-text="Back to: Learning Hub" />
}
<h1 class="nhsuk-u-margin-bottom-5">
@(hasSearchTerm ? $"Search results for {searchTerm}" : "All catalogues")
</h1>

<h2 class="nhsuk-u-margin-bottom-5">
@($"{Model.TotalCount} catalogue results")
</h2>

<div class="nhsuk-grid-row">
<div id="searchTab" class="search-page">
<div class="nhsuk-grid-column-two-thirds">
@await Html.PartialAsync("_AllCatalogueSearchBar", searchTerm)
</div>
</div>
</div>
@if (Model.TotalCount > 0)
{
<h2 class="nhsuk-u-margin-bottom-5">
@($"{Model.TotalCount} catalogue results")
</h2>
}

<ul class="nhsuk-grid-row nhsuk-card-group nhsuk-card-group--centred">

Expand Down Expand Up @@ -129,4 +134,18 @@

@await Html.PartialAsync("_Pagination", new PaginationViewModel(currentPage, totalPage, prevUrl, nextUrl))
}

@if (Model.TotalCount == 0)
{
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-full">
<h2 class="nhsuk-heading-l">No results found for @searchTerm</h2>
<p>You could try:</p>
<ul class="nhsuk-list nhsuk-list--bullet">
<li>checking your spelling</li>
<li>searching again using other words</li>
</ul>
</div>
</div>
}
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@model LearningHub.Nhs.Models.Catalogue.AllCatalogueResponseViewModel;
@model string
<form id="search" asp-controller="catalogue" asp-action="GetAllCatalogueSearch" asp-fragment="searchTab" method="get" role="search">
<div class="nhsuk-form-group nhsuk-header__search-form--search-results">
<label class="nhsuk-label nhsuk-u-visually-hidden" for="sub-search-field">Search</label>
<input class="nhsuk-input nhsuk-search__input" type="search" name="term" autocomplete="off" id="sub-search-field" placeholder="Search for a catalogue">
<input class="nhsuk-input nhsuk-search__input" type="search" value="@Model" name="term" autocomplete="off" id="sub-search-field" placeholder="Search for a catalogue">
<button class="nhsuk-search__submit" type="submit">
<span class="nhsuk-u-visually-hidden">Search</span>
<svg class="nhsuk-icon nhsuk-icon__search" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
Expand Down
Loading