diff --git a/app/helpers/investigations_helper.rb b/app/helpers/investigations_helper.rb index ffa66162d7..2959565e48 100644 --- a/app/helpers/investigations_helper.rb +++ b/app/helpers/investigations_helper.rb @@ -568,6 +568,17 @@ def non_search_cases_page_names %w[team_cases your_cases assigned_cases].freeze end + def calculate_row_index(investigation_counter, row_number) + # Each investigation has 3 rows (title, meta, status) + # So for investigation 0, rows are 1,2,3 + # For investigation 1, rows are 4,5,6 etc. + (investigation_counter * 3) + row_number + end + + def investigation_owner(investigation) + sanitize(investigation.owner_display_name_for(viewer: current_user)) + end + private def search_result_values(_search_terms, number_of_results) diff --git a/app/views/investigations/_full_table_body.html.erb b/app/views/investigations/_full_table_body.html.erb index 8dd937db0f..969a144e16 100644 --- a/app/views/investigations/_full_table_body.html.erb +++ b/app/views/investigations/_full_table_body.html.erb @@ -1,54 +1,58 @@
-<% if @records_count == 1 %>There is currently 1 business.<% else %>There are currently <%= @records_count %> businesses.<% end %>
<%= - govuk_table do |table| + govuk_table(html_attributes: { role: "table" }) do |table| table.with_head do |head| head.with_row do |row| - row.with_cell(text: "Trading name") - row.with_cell(text: "Registered or Legal name") - row.with_cell(text: "Companies House number") - row.with_cell(text: "Address") - row.with_cell(text: "Select business".html_safe) + row.with_cell(text: "Trading name", header: true, html_attributes: { scope: "col" }) + row.with_cell(text: "Registered or Legal name", header: true, html_attributes: { scope: "col" }) + row.with_cell(text: "Companies House number", header: true, html_attributes: { scope: "col" }) + row.with_cell(text: "Address", header: true, html_attributes: { scope: "col" }) + row.with_cell(text: "Select business".html_safe, header: true, html_attributes: { scope: "col" }) end end @@ -86,8 +86,18 @@ end.join("