Skip to content

Commit 666871b

Browse files
Merge pull request #580 from TechnologyEnhancedLearning/Develop/Fixes/TD-4038-Empty-Search-wordings-updated
TD-4038: Message updated for empty search in AllCatalogues and main search pages
2 parents b3f0436 + 4ac9c16 commit 666871b

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

LearningHub.Nhs.WebUI/Views/Catalogue/AllCatalogueSearch.cshtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
var queryParams = QueryHelpers.ParseQuery(Context.Request.QueryString.ToString());
99
var hasSearchTerm = queryParams.ContainsKey("term");
10-
var searchTerm = hasSearchTerm ? queryParams["term"].ToString() : null;
10+
var searchTerm = hasSearchTerm ? queryParams["term"].ToString().Trim() : null;
1111
string cardStyle = "card-provider-details--blank";
1212
var pageSize = this.ViewBag.PageSize;
1313
}
@@ -22,9 +22,9 @@
2222
var parms = new Dictionary<string, string> { { "term", searchTerm } };
2323
<vc:back-link asp-controller="Catalogue" asp-action="GetAllCatalogue" link-text="Back to A-Z of catalogues" />
2424
}
25-
<h1 class="nhsuk-u-margin-bottom-5">
26-
@(hasSearchTerm ? $"Search results for {searchTerm}" : "All catalogues")
27-
</h1>
25+
<h1 class="nhsuk-u-margin-bottom-5">
26+
Search results @(!string.IsNullOrEmpty(searchTerm) ? "for " + searchTerm : string.Empty)
27+
</h1>
2828

2929
<div class="nhsuk-grid-row">
3030
<div id="searchTab" class="search-page">
@@ -139,7 +139,7 @@
139139
{
140140
<div class="nhsuk-grid-row">
141141
<div class="nhsuk-grid-column-full">
142-
<h2 class="nhsuk-heading-l">No results found for @searchTerm</h2>
142+
<h2 class="nhsuk-heading-l">No results found @(!string.IsNullOrEmpty(searchTerm) ? "for " + searchTerm : string.Empty)</h2>
143143
<p>You could try:</p>
144144
<ul class="nhsuk-list nhsuk-list--bullet">
145145
<li>checking your spelling</li>

LearningHub.Nhs.WebUI/Views/Search/Index.cshtml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010

1111
<div class="search-page">
1212
<div class="nhsuk-width-container app-width-container">
13-
14-
<h1 class="nhsuk-u-margin-top-5 nhsuk-u-margin-bottom-6">
15-
Search results for @Model.SearchString
16-
</h1>
17-
13+
<h1 class="nhsuk-u-margin-top-5 nhsuk-u-margin-bottom-6">
14+
Search results @(!string.IsNullOrEmpty(Model.SearchString) ? "for " + Model.SearchString : string.Empty)
15+
</h1>
16+
1817
<div class="nhsuk-grid-row">
1918
<div class="nhsuk-grid-column-two-thirds">
2019
@await Html.PartialAsync("_SearchBar", @Model.SearchString)
@@ -48,7 +47,7 @@
4847
{
4948
<div class="nhsuk-grid-row">
5049
<div class="nhsuk-grid-column-full">
51-
<h2 class="nhsuk-heading-l">No results found for @Model.SearchString</h2>
50+
<h2 class="nhsuk-heading-l">No results found @(!string.IsNullOrEmpty(Model.SearchString) ? "for " + Model.SearchString : string.Empty)</h2>
5251
<p>You could try:</p>
5352
<ul class="nhsuk-list nhsuk-list--bullet">
5453
<li>checking your spelling</li>

0 commit comments

Comments
 (0)