Paul Robert Lloyd
3 years ago
8 changed files with 135 additions and 90 deletions
@ -1,29 +1,46 @@
|
||||
<figure class="app-figure"> |
||||
<figcaption id="<%= title.dasherize %>" class="app-figure__caption"> |
||||
<b><%= case_logs.count %></b> <%= title.downcase %> |
||||
</figcaption> |
||||
<div class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
||||
<table class="govuk-table"> |
||||
<caption class="govuk-table__caption govuk-table__caption--m"><%= title %></caption> |
||||
<thead class="govuk-table__head"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="col" class="govuk-table__header">Log reference</th> |
||||
<th scope="col" class="govuk-table__header">Postcode</th> |
||||
<th scope="col" class="govuk-table__header">Tenant code</th> |
||||
<th scope="col" class="govuk-table__header"><%= date_title %></th> |
||||
<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">Tenacy starts</th> |
||||
<th class="govuk-table__header" scope="col">Log created</th> |
||||
<th class="govuk-table__header" scope="col">Completed</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody class="govuk-table__body"> |
||||
<% case_logs.map do |log| %> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header"> |
||||
<th class="govuk-table__header" scope="row"> |
||||
<%= govuk_link_to log.id, case_log_path(log) %> |
||||
</th> |
||||
<td class="govuk-table__cell govuk-table__cell"> |
||||
<%= log.property_postcode %> |
||||
<td class="govuk-table__cell app-!-font-tabular"> |
||||
<%= log.tenant_code? ? log.tenant_code : '–' %> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-table__cell"> |
||||
<%= log.tenant_code %> |
||||
<td class="govuk-table__cell app-!-font-tabular"> |
||||
<%= log.propcode? ? log.propcode : '–' %> |
||||
</td> |
||||
<td id="last-changed" class="govuk-table__cell"> |
||||
<%= log.updated_at.to_formatted_s(:govuk_date) %> |
||||
<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> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</figure> |
||||
|
@ -0,0 +1,10 @@
|
||||
.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); |
||||
} |
@ -0,0 +1,44 @@
|
||||
.app-table-group { |
||||
overflow-x: auto; |
||||
overflow-y: hidden; |
||||
margin: govuk-spacing(-3) govuk-spacing(-3) govuk-spacing(3); |
||||
padding: 0 govuk-spacing(3); |
||||
scrollbar-color: $govuk-text-colour govuk-colour("light-grey"); |
||||
|
||||
.govuk-table { |
||||
margin-bottom: -1px; |
||||
} |
||||
|
||||
.govuk-table__header, |
||||
.govuk-table__cell { |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
&::-webkit-scrollbar { |
||||
height: govuk-spacing(1); |
||||
width: govuk-spacing(1); |
||||
} |
||||
|
||||
&::-webkit-scrollbar-thumb { |
||||
background: $govuk-text-colour; |
||||
} |
||||
|
||||
&::-webkit-scrollbar-track { |
||||
background: govuk-colour("light-grey"); |
||||
} |
||||
} |
||||
|
||||
.app-table-group:focus { |
||||
box-shadow: 0 0 0 #{$govuk-focus-width * 2} $govuk-focus-colour; |
||||
outline: $govuk-focus-width solid govuk-colour("black"); |
||||
} |
||||
|
||||
.app-table-group:focus:not(:focus-visible) { |
||||
box-shadow: none; |
||||
outline: none; |
||||
} |
||||
|
||||
.app-table-group:focus-visible { |
||||
box-shadow: 0 0 0 #{$govuk-focus-width * 2} $govuk-focus-colour; |
||||
outline: $govuk-focus-width solid govuk-colour("black"); |
||||
} |
Loading…
Reference in new issue