Browse Source

Merge pull request #534 from communitiesuk/bug/cldc-1184-a11y-logs-table

CLDC-1184: re-add tabindex to the logs table
pull/535/head
Kidd Hustle 3 years ago committed by GitHub
parent
commit
6afb02abe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/frontend/styles/_figure.scss
  2. 1
      app/frontend/styles/application.scss
  3. 108
      app/views/case_logs/_log_list.html.erb

10
app/frontend/styles/_figure.scss

@ -1,10 +0,0 @@
.app-figure {
margin: 0;
}
.app-figure__caption {
@include govuk-font($size: 19);
border-top: 1px solid $govuk-border-colour;
margin-bottom: govuk-spacing(6);
padding-top: govuk-spacing(4);
}

1
app/frontend/styles/application.scss

@ -18,7 +18,6 @@ $govuk-new-link-styles: true;
@import "button";
@import "card";
@import "document-list";
@import "figure";
@import "filter";
@import "filter-layout";
@import "header";

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

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

Loading…
Cancel
Save