Browse Source

Merge pull request #504 from communitiesuk/bug/cldc-1174

cldc-1174, cldc-1184: fix table semantics and markup
pull/520/head
Kidd Hustle 3 years ago committed by GitHub
parent
commit
e0bbcbb66b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 110
      app/views/case_logs/_log_list.html.erb

110
app/views/case_logs/_log_list.html.erb

@ -1,61 +1,57 @@
<figure class="app-figure"> <table class="govuk-table">
<figcaption id="<%= title.dasherize %>" class="app-figure__caption"> <caption class="govuk-!-text-align-left govuk-!-margin-top-4 govuk-!-margin-bottom-4">
<span class="govuk-!-margin-right-4"> <span class="govuk-!-margin-right-4">
<strong><%= pagy.count %></strong> total <%= title.downcase %> <strong><%= pagy.count %></strong> total <%= title.downcase %>
</span> </span>
<%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %> <%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %>
</figcaption> </caption>
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> <thead class="govuk-table__head">
<table class="govuk-table"> <tr class="govuk-table__row">
<thead class="govuk-table__head"> <th class="govuk-table__header" scope="col">Log</th>
<tr class="govuk-table__row"> <th class="govuk-table__header" scope="col">Tenant</th>
<th class="govuk-table__header" scope="col">Log</th> <th class="govuk-table__header" scope="col">Property</th>
<th class="govuk-table__header" scope="col">Tenant</th> <th class="govuk-table__header" scope="col">Tenancy starts</th>
<th class="govuk-table__header" scope="col">Property</th> <th class="govuk-table__header" scope="col">Log created</th>
<th class="govuk-table__header" scope="col">Tenancy starts</th> <th class="govuk-table__header" scope="col">Completed</th>
<th class="govuk-table__header" scope="col">Log created</th> <% if current_user.support? %>
<th class="govuk-table__header" scope="col">Completed</th> <th class="govuk-table__header" scope="col">Owning organisation</th>
<% if current_user.support? %> <th class="govuk-table__header" scope="col">Managing organisation</th>
<th class="govuk-table__header" scope="col">Owning organisation</th> <% end %>
<th class="govuk-table__header" scope="col">Managing organisation</th> </tr>
<% end %> </thead>
</tr> <tbody class="govuk-table__body">
</thead> <% case_logs.map do |log| %>
<tbody class="govuk-table__body"> <tr class="govuk-table__row">
<% case_logs.map do |log| %> <th class="govuk-table__header" scope="row">
<tr class="govuk-table__row"> <%= govuk_link_to log.id, case_log_path(log) %>
<th class="govuk-table__header" scope="row"> </th>
<%= govuk_link_to log.id, case_log_path(log) %> <td class="govuk-table__cell app-!-font-tabular">
</th> <%= log.tenant_code? ? log.tenant_code : "–" %>
<td class="govuk-table__cell app-!-font-tabular"> </td>
<%= log.tenant_code? ? log.tenant_code : "–" %> <td class="govuk-table__cell app-!-font-tabular">
</td> <%= log.propcode? ? log.propcode : "–" %>
<td class="govuk-table__cell app-!-font-tabular"> </td>
<%= log.propcode? ? log.propcode : "–" %> <td class="govuk-table__cell">
</td> <%= log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : "–" %>
<td class="govuk-table__cell"> </td>
<%= log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : "–" %> <td class="govuk-table__cell">
</td> <%= log.created_at.to_formatted_s(:govuk_date) %>
<td class="govuk-table__cell"> </td>
<%= log.created_at.to_formatted_s(:govuk_date) %> <td class="govuk-table__cell">
</td> <%= govuk_tag(
<td class="govuk-table__cell"> colour: log.status == "completed" ? "blue" : "grey",
<%= govuk_tag( text: log.status.humanize,
colour: log.status == "completed" ? "blue" : "grey", ) %>
text: log.status.humanize, </td>
) %> <% if current_user.support? %>
</td> <td class="govuk-table__cell">
<% if current_user.support? %> <%= log.owning_organisation.name %>
<td class="govuk-table__cell"> </td>
<%= log.owning_organisation.name %> <td class="govuk-table__cell">
</td> <%= log.managing_organisation.name %>
<td class="govuk-table__cell"> </td>
<%= log.managing_organisation.name %> <% end %>
</td> </tr>
<% end %> <% end %>
</tr> </tbody>
<% end %> </table>
</tbody>
</table>
</section>
</figure>

Loading…
Cancel
Save