% content_for :before_content do %>
<%= govuk_back_link(
text: 'Back',
href: :back,
) %>
<% end %>
Your Organisation
<%= govuk_tabs(title: "Your Organisation") do |component| %>
<%= component.tab(label: "Details") do |tab| %>
<%= govuk_summary_list do |summary_list| %>
<% @organisation.display_attributes.each do |attr, val| %>
<%= summary_list.row do |row|
row.key { attr.to_s.humanize }
row.value { simple_format(val, {}, wrapper_tag: "div") }
end %>
<% end %>
<% end %>
<% end %>
<%= component.tab(label: "Users") do |tab| %>
<%= govuk_table do |table| %>
<%= table.head do |head| %>
<%= head.row do |row|
row.cell(header: true, text: "Name and email adress")
row.cell(header: true, text: "Organisation and role")
row.cell(header: true, text: "Last logged in")
end %>
<% end %>
<% @organisation.users.each do |user| %>
<%= table.body do |body| %>
<%= body.row do |row|
row.cell(text: simple_format(user.name_email_display, {}, wrapper_tag: "div"))
row.cell(text: simple_format(user.org_role_display, {}, wrapper_tag: "div"))
row.cell(text: user.last_sign_in_at )
end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>