Skip to content

Commit

Permalink
Merge pull request #204 from DFE-Digital/2059-results-count
Browse files Browse the repository at this point in the history
Display results count
  • Loading branch information
slawosz authored Aug 28, 2024
2 parents 4859681 + dd814f1 commit b8bf9f6
Show file tree
Hide file tree
Showing 3 changed files with 472 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/lib/local_authority/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ def initialize(scope, query)
end

def call
return [] if geo_result.nil?

result = @scope.order_by_distance_from(search_centre)

if search_polygon
Expand Down
15 changes: 15 additions & 0 deletions app/views/search/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
</div>
</div>

<div class="govuk-grid-column-two-thirds">
<p class="govuk-body-l">
<b><%= pluralize(@search.hubs.count, 'result') %> found</b>
</p>
<% if @search.hubs.count.zero? %>
<p class="govuk-body">
Check that the location you have entered is in England and:
<ul class="govuk-list govuk-list--bullet">
<li>a valid first part of a postcode</li>
<li>or, a town or city</li>
</ul>
</p>
<% end %>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p>
Expand Down
Loading

0 comments on commit b8bf9f6

Please sign in to comment.