Browse Source

CLDC-1184: re-add tabindex to the logs table

pull/534/head
kiddhustle 3 years ago
parent
commit
6528777403
  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 "button";
@import "card"; @import "card";
@import "document-list"; @import "document-list";
@import "figure";
@import "filter"; @import "filter";
@import "filter-layout"; @import "filter-layout";
@import "header"; @import "header";

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

@ -1,57 +1,59 @@
<table class="govuk-table"> <section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<caption class="govuk-!-text-align-left govuk-!-margin-top-4 govuk-!-margin-bottom-4"> <table class="govuk-table">
<span class="govuk-!-margin-right-4"> <caption id="<%= title.dasherize %>" class="govuk-!-text-align-left govuk-!-margin-top-4 govuk-!-margin-bottom-4">
<strong><%= pagy.count %></strong> total <%= title.downcase %> <span class="govuk-!-margin-right-4">
</span> <strong><%= pagy.count %></strong> total <%= title.downcase %>
<%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %> </span>
</caption> <%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %>
<thead class="govuk-table__head"> </caption>
<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>
<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? %>
<td class="govuk-table__cell"> <td class="govuk-table__cell">
<%= log.owning_organisation.name %> <%= log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : "–" %>
</td> </td>
<td class="govuk-table__cell"> <td class="govuk-table__cell">
<%= log.managing_organisation.name %> <%= log.created_at.to_formatted_s(:govuk_date) %>
</td> </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 %> <% end %>
</tr> </tbody>
<% end %> </table>
</tbody> </section>
</table>

Loading…
Cancel
Save