Skip to content

Commit

Permalink
Make use of the govuk table helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
Kizr committed Jan 31, 2025
1 parent c07bb78 commit 4387832
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@

<h3 class="govuk-heading-s"><%= claim_activity.record.provider_name %></h3>

<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header"><%= t(".claim_reference") %></th>
<th scope="col" class="govuk-table__header"><%= t(".number_of_mentors") %></th>
<th scope="col" class="govuk-table__header"><%= t(".claim_amount") %></th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<td class="govuk-table__cell"><%= govuk_link_to claim_activity.record.reference, claims_support_claim_path(claim_activity.record) %></td>
<td class="govuk-table__cell"><%= claim_activity.record.mentors.count %></td>
<td class="govuk-table__cell"><%= humanized_money_with_symbol(claim_activity.record.amount) %></td>
</tr>
</tbody>
</table>
<%= govuk_table do |table| %>
<% table.with_head do |head| %>
<% head.with_row do |row| %>
<% row.with_cell text: t(".claim_reference") %>
<% row.with_cell text: t(".number_of_mentors") %>
<% row.with_cell text: t(".claim_amount") %>
<% end %>
<% end %>

<% table.with_body do |body| %>
<% body.with_row do |row| %>
<% row.with_cell text: govuk_link_to(claim_activity.record.reference, claims_support_claim_path(claim_activity.record)) %>
<% row.with_cell text: claim_activity.record.mentors.count %>
<% row.with_cell text: humanized_money_with_symbol(claim_activity.record.amount) %>
<% end %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
<% claim_activity.record.claims.group_by(&:provider).each do |provider, provider_claims| %>
<h3 class="govuk-heading-s"><%= provider.name %></h3>

<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header"><%= t(".claim_reference") %></th>
<th scope="col" class="govuk-table__header"><%= t(".number_of_mentors") %></th>
<th scope="col" class="govuk-table__header"><%= t(".claim_amount") %></th>
</tr>
</thead>
<tbody class="govuk-table__body">
<% provider_claims.each do |claim| %>
<tr class="govuk-table__row">
<td class="govuk-table__cell"><%= govuk_link_to claim.reference, claims_support_claim_path(claim) %></td>
<td class="govuk-table__cell"><%= claim.mentors.count %></td>
<td class="govuk-table__cell"><%= humanized_money_with_symbol(claim.amount) %></td>
</tr>
<%= govuk_table do |table| %>
<% table.with_head do |head| %>
<% head.with_row do |row| %>
<% row.with_cell text: t(".claim_reference") %>
<% row.with_cell text: t(".number_of_mentors") %>
<% row.with_cell text: t(".claim_amount") %>
<% end %>
<% end %>
</tbody>
</table>

<% table.with_body do |body| %>
<% provider_claims.each do |claim| %>
<% body.with_row do |row| %>
<% row.with_cell text: govuk_link_to(claim.reference, claims_support_claim_path(claim)) %>
<% row.with_cell text: claim.mentors.count %>
<% row.with_cell text: humanized_money_with_symbol(claim.amount) %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
<% end %>
</div>

<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header"><%= t(".claim_reference") %></th>
<th scope="col" class="govuk-table__header"><%= t(".number_of_mentors") %></th>
<th scope="col" class="govuk-table__header"><%= t(".claim_amount") %></th>
</tr>
</thead>
<tbody class="govuk-table__body">
<% provider_sampling.claims.each do |claim| %>
<tr class="govuk-table__row">
<td class="govuk-table__cell"><%= govuk_link_to claim.reference, claims_support_claim_path(claim) %></td>
<td class="govuk-table__cell"><%= claim.mentors.count %></td>
<td class="govuk-table__cell"><%= humanized_money_with_symbol(claim.amount) %></td>
</tr>
<%= govuk_table do |table| %>
<% table.with_head do |head| %>
<% head.with_row do |row| %>
<% row.with_cell text: t(".claim_reference") %>
<% row.with_cell text: t(".number_of_mentors") %>
<% row.with_cell text: t(".claim_amount") %>
<% end %>
<% end %>
</tbody>
</table>

<% table.with_body do |body| %>
<% provider_sampling.claims.each do |claim| %>
<% body.with_row do |row| %>
<% row.with_cell text: govuk_link_to(claim.reference, claims_support_claim_path(claim)) %>
<% row.with_cell text: claim.mentors.count %>
<% row.with_cell text: humanized_money_with_symbol(claim.amount) %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>

0 comments on commit 4387832

Please sign in to comment.