4 changed files with 82 additions and 78 deletions
@ -1,35 +1,37 @@ |
|||||||
<%= govuk_table do |table| %> |
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
||||||
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> |
<%= govuk_table do |table| %> |
||||||
<% if searched.present? %> |
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> |
||||||
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total organisations. <%= govuk_link_to("Clear search", request.path) %> |
<% if searched.present? %> |
||||||
<% else %> |
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total organisations. <%= govuk_link_to("Clear search", request.path) %> |
||||||
<strong><%= pagy.count %></strong> total organisations. |
<% else %> |
||||||
|
<strong><%= pagy.count %></strong> total organisations. |
||||||
|
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<%= table.head do |head| %> |
||||||
<%= table.head do |head| %> |
<%= head.row do |row| %> |
||||||
<%= head.row do |row| %> |
<% row.cell(header: true, text: "Name", html_attributes: { |
||||||
<% row.cell(header: true, text: "Name", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% row.cell(header: true, text: "Registration number", html_attributes: { |
||||||
<% row.cell(header: true, text: "Registration number", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% row.cell(header: true, text: "Type", html_attributes: { |
||||||
<% row.cell(header: true, text: "Type", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% @organisations.each do |organisation| %> |
||||||
<% @organisations.each do |organisation| %> |
<%= table.body do |body| %> |
||||||
<%= table.body do |body| %> |
<%= body.row do |row| %> |
||||||
<%= body.row do |row| %> |
<% row.cell(header: true, html_attributes: { |
||||||
<% row.cell(header: true, html_attributes: { |
scope: "row", |
||||||
scope: "row", |
}) do %> |
||||||
}) do %> |
<%= govuk_link_to(organisation.name, "organisations/#{organisation.id}/logs") %> |
||||||
<%= govuk_link_to(organisation.name, "organisations/#{organisation.id}/logs") %> |
<% end %> |
||||||
|
<% row.cell(text: organisation.housing_registration_no) %> |
||||||
|
<% row.cell(text: organisation.display_provider_type) %> |
||||||
<% end %> |
<% end %> |
||||||
<% row.cell(text: organisation.housing_registration_no) %> |
|
||||||
<% row.cell(text: organisation.display_provider_type) %> |
|
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
</section> |
||||||
|
@ -1,54 +1,56 @@ |
|||||||
<%= govuk_table do |table| %> |
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
||||||
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> |
<%= govuk_table do |table| %> |
||||||
<span class="govuk-!-margin-right-4"> |
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> |
||||||
<% if searched.present? %> |
<span class="govuk-!-margin-right-4"> |
||||||
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total users. <%= govuk_link_to("Clear search", request.path) %> |
<% if searched.present? %> |
||||||
<% else %> |
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total users. <%= govuk_link_to("Clear search", request.path) %> |
||||||
<strong><%= pagy.count %></strong> total users. |
<% 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 %> |
||||||
</span> |
|
||||||
<% if current_user.support? %> |
|
||||||
<% query = searched.present? ? "?search=#{searched}" : nil %> |
|
||||||
<%= govuk_link_to "Download (CSV)", "/users.csv#{query}", type: "text/csv" %> |
|
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<%= table.head do |head| %> |
||||||
<%= table.head do |head| %> |
<%= head.row do |row| %> |
||||||
<%= head.row do |row| %> |
<% row.cell(header: true, text: "Name and email adress", html_attributes: { |
||||||
<% row.cell(header: true, text: "Name and email adress", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% row.cell(header: true, text: "Organisation and role", html_attributes: { |
||||||
<% row.cell(header: true, text: "Organisation and role", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% row.cell(header: true, text: "Last logged in", html_attributes: { |
||||||
<% row.cell(header: true, text: "Last logged in", html_attributes: { |
scope: "col", |
||||||
scope: "col", |
}) %> |
||||||
}) %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% users.each do |user| %> |
||||||
<% users.each do |user| %> |
<%= table.body do |body| %> |
||||||
<%= table.body do |body| %> |
<%= body.row do |row| %> |
||||||
<%= body.row do |row| %> |
<% row.cell(header: true, html_attributes: { |
||||||
<% row.cell(header: true, html_attributes: { |
scope: "row", |
||||||
scope: "row", |
}) do %> |
||||||
}) do %> |
<%= simple_format(user_cell(user), {}, wrapper_tag: "span") %> |
||||||
<%= simple_format(user_cell(user), {}, wrapper_tag: "span") %> |
<% if user.is_data_protection_officer? || user.is_key_contact? %> |
||||||
<% if user.is_data_protection_officer? || user.is_key_contact? %> |
<br> |
||||||
<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 %> |
<% end %> |
||||||
<%= user.is_data_protection_officer? ? govuk_tag( |
<% row.cell(text: simple_format(org_cell(user), {}, wrapper_tag: "div")) %> |
||||||
classes: "app-tag--small", |
<% row.cell(text: user.last_sign_in_at&.to_formatted_s(:govuk_date)) %> |
||||||
colour: "turquoise", |
|
||||||
text: "Data protection officer", |
|
||||||
) : "" %> |
|
||||||
<%= user.is_key_contact? ? govuk_tag( |
|
||||||
classes: "app-tag--small", |
|
||||||
colour: "turquoise", |
|
||||||
text: "Key contact", |
|
||||||
) : "" %> |
|
||||||
<% end %> |
<% end %> |
||||||
<% row.cell(text: simple_format(org_cell(user), {}, wrapper_tag: "div")) %> |
|
||||||
<% row.cell(text: user.last_sign_in_at&.to_formatted_s(:govuk_date)) %> |
|
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
</section> |
||||||
|
Loading…
Reference in new issue