Skip to content

Commit

Permalink
Merge pull request #9465 from DFE-Digital/1780-performance-report-inv…
Browse files Browse the repository at this point in the history
…estigate-formatting-issues

[1780] Fix rendering where the section after an empty state was outside main tag
  • Loading branch information
elceebee authored Jun 13, 2024
2 parents 93243cd + 699ed28 commit 1617076
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<p class="govuk-body"><%= t('deferrals_table_component.description_one', provider_name:) %></p>
<p class="govuk-body"><%= t('deferrals_table_component.description_two') %></p>

<div class="recruitment-performance-report-table__wrapper">
<% if deferral_rows.empty? %>
<p class="govuk-body"><%= t('shared.empty_state') %></p>
<% else %>
<div class="recruitment-performance-report-table__wrapper">
<%= govuk_table do |table| %>
<%= table.with_caption(text: t('deferrals_table_component.caption'),
html_attributes: { class: 'govuk-visually-hidden' }) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<p class="govuk-body"><%= t('proportion_with_inactive_applications_table_component.description_two') %></p>
<p class="govuk-body"><%= t('proportion_with_inactive_applications_table_component.description_three') %></p>

<div class="recruitment-performance-report-table__wrapper">
<% if subject_rows.empty? %>
<p class="govuk-body"><%= t('shared.empty_state') %></p>
<% else %>
<div class="recruitment-performance-report-table__wrapper">
<%= govuk_table do |table| %>
<%= table.with_caption(text: t('proportion_with_inactive_applications_table_component.caption'),
html_attributes: { class: 'govuk-visually-hidden' }) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,47 @@
<% end %>
<%= content %>

<div class="recruitment-performance-report-table__wrapper">
<% if subject_rows.empty? %>
<p class="govuk-body"><%= t('shared.empty_state') %></p>
<% else %>
<div class="recruitment-performance-report-table__wrapper">
<%= govuk_table do |table| %>
<%= table.with_caption(text: t("subject_table_component.#{table_caption}"),
html_attributes: { class: 'govuk-visually-hidden' }) %>
<%= govuk_table do |table| %>
<%= table.with_caption(text: t("subject_table_component.#{table_caption}"),
html_attributes: { class: 'govuk-visually-hidden' }) %>
<%= table.with_colgroup do |colgroup| %>
<%= colgroup.with_col(span: 1) %>
<%= colgroup.with_col(span: colspan) %>
<%= colgroup.with_col(span: colspan) %>
<%= table.with_colgroup do |colgroup| %>
<%= colgroup.with_col(span: 1) %>
<%= colgroup.with_col(span: colspan) %>
<%= colgroup.with_col(span: colspan) %>
<% end %>
<%= table.with_head do |head| %>
<%= head.with_row do |row| %>
<%= row.with_cell(scope: false,
html_attributes: { class: 'recruitment-performance-report-table__heading--no-border' }) %>
<%= row.with_cell(text: provider_name, colspan:, scope: 'colgroup',
html_attributes: { class: 'recruitment-performance-report-table__heading' }) %>
<%= row.with_cell(text: t('shared.all_providers'), colspan:, scope: 'colgroup',
html_attributes: { class: 'recruitment-performance-report-table__heading' }) %>
<% end %>
<%= table.with_head do |head| %>
<%= head.with_row do |row| %>
<%= row.with_cell(scope: false,
html_attributes: { class: 'recruitment-performance-report-table__heading--no-border' }) %>
<%= row.with_cell(text: provider_name, colspan:, scope: 'colgroup',
html_attributes: { class: 'recruitment-performance-report-table__heading' }) %>
<%= row.with_cell(text: t('shared.all_providers'), colspan:, scope: 'colgroup',
html_attributes: { class: 'recruitment-performance-report-table__heading' }) %>
<% end %>
<%= head.with_row do |row| %>
<%= row.with_cell(text: t('shared.subject'), **subheading_html_attributes) %>
<% columns.each do |column| %>
<%= row.with_cell(text: t("subject_table_component.#{column}"),
numeric: true,
**subheading_html_attributes(column)) %>
<% end %>
<%= head.with_row do |row| %>
<%= row.with_cell(text: t('shared.subject'), **subheading_html_attributes) %>
<% columns.each do |column| %>
<%= row.with_cell(text: t("subject_table_component.#{column}"),
numeric: true,
**subheading_html_attributes(column)) %>
<% end %>
<% end %>
<% end %>
<% table.with_body do |body| %>
<% subject_rows.each do |subject_row| %>
<% body.with_row do |row| %>
<%= row.with_cell(header: true, text: subject_row.title, **level_html_attributes(subject_row)) %>
<%= columns.each do |column| %>
<%= row.with_cell(text: format_number(subject_row, column), numeric: true,
**numeric_html_attributes(column)) %>
<% table.with_body do |body| %>
<% subject_rows.each do |subject_row| %>
<% body.with_row do |row| %>
<%= row.with_cell(header: true, text: subject_row.title, **level_html_attributes(subject_row)) %>
<%= columns.each do |column| %>
<%= row.with_cell(text: format_number(subject_row, column), numeric: true,
**numeric_html_attributes(column)) %>
<% end %>
<% end %>
<% end %>
Expand Down

0 comments on commit 1617076

Please sign in to comment.