diff --git a/app/views/case_logs/_log_list.html.erb b/app/views/case_logs/_log_list.html.erb index 87c5c1ed7..bb2efe184 100644 --- a/app/views/case_logs/_log_list.html.erb +++ b/app/views/case_logs/_log_list.html.erb @@ -1,9 +1,11 @@ <%= govuk_table do |table| %> <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %> - + <% if searched.present? %> + <%= pagy.count %> <%= item_label %> found matching ‘<%= searched %>’ of <%= total_count %> total <%= title.downcase %>. <%= govuk_link_to("Clear search", request.path) %> + <% else %> <%= pagy.count %> total <%= title.downcase %> - + <% end %> <%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %> <% end %> <%= table.head do |head| %> diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb index e51be3c8a..dcbe1a3d2 100644 --- a/app/views/case_logs/index.html.erb +++ b/app/views/case_logs/index.html.erb @@ -1,10 +1,22 @@ +<% item_label = @pagy.count > 1 ? "logs" : "log" %> + +<% if @searched.present? %> + <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %> +<% else %> + <% title = "Your organisation (Logs)" %> +<% end %> + + + <% content_for :title, "Logs" %> <%= content_for(:title) %> -<%= render LogSearchComponent.new(current_user:, label: "Search by log ID, tenant code, property reference or postcode") %> +<%= render SearchComponent.new(current_user:, search_label: "Search by log ID, tenant code, property reference or postcode", value: @searched) %> + + @@ -15,7 +27,7 @@ <%= render partial: "log_filters" %> <% if @case_logs.present? %> - <%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy } %> + <%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy, searched: @searched, item_label:, total_count: @total_count } %> <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "logs" } %> <% end %>