Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

59 lines
2.4 KiB

<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<span class="govuk-!-margin-right-4">
<% if searched.present? %>
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total users. <%= govuk_link_to("Clear search", request.path) %>
<% else %>
<strong><%= pagy.count %></strong> total users.
<% end %>
</span>
<% if current_user.support? %>
<% query = searched.present? ? "?search=#{searched}" : nil %>
<%= govuk_link_to "Download (CSV)", "/users.csv#{query}", type: "text/csv" %>
<% end %>
<% end %>
<%= table.head do |head| %>
<%= head.row do |row| %>
<% row.cell(header: true, text: "Name and email adress", html_attributes: {
scope: "col",
}) %>
<% row.cell(header: true, text: "Organisation and role", html_attributes: {
scope: "col",
}) %>
<% row.cell(header: true, text: "Last logged in", html_attributes: {
scope: "col",
}) %>
<% end %>
<% end %>
<% users.each do |user| %>
<%= table.body do |body| %>
<%= body.row do |row| %>
<% row.cell(header: true, html_attributes: {
scope: "row",
}) do %>
<%= simple_format(user_cell(user), {}, wrapper_tag: "span") %>
<% if user.is_data_protection_officer? || user.is_key_contact? %>
<br>
<% end %>
<%= user.is_data_protection_officer? ? govuk_tag(
classes: "app-tag--small",
colour: "turquoise",
text: "Data protection officer",
) : "" %>
<%= user.is_key_contact? ? govuk_tag(
classes: "app-tag--small",
colour: "turquoise",
text: "Key contact",
) : "" %>
<% end %>
<% row.cell(text: simple_format(org_cell(user), {}, wrapper_tag: "div")) %>
<% row.cell(text: user.active? ? user.last_sign_in_at&.to_formatted_s(:govuk_date) : "Deactivated") %>
<%= govuk_link_to users_path(user) do %>
<span class="govuk-visually-hidden">User </span><%= user.id %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
</section>