Browse Source
* Hide inactive users and allow support users to view all users * Enable support users to invite users to any organisation * Add pagination to user viewspull/577/head
baarkerlounger
3 years ago
committed by
GitHub
8 changed files with 138 additions and 39 deletions
@ -1,27 +0,0 @@
|
||||
<% content_for :title, "Your organisation (Users)" %> |
||||
|
||||
<% content_for :tab_title do %> |
||||
<%= "Users" %> |
||||
<% end %> |
||||
|
||||
<% if current_user.data_coordinator? || current_user.support? %> |
||||
<%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> |
||||
<% end %> |
||||
<%= 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_cell(user), {}, wrapper_tag: "div")) %> |
||||
<% 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 %> |
@ -0,0 +1,33 @@
|
||||
<% content_for :title, "Your organisation (Users)" %> |
||||
|
||||
<% content_for :tab_title do %> |
||||
<%= "Users" %> |
||||
<% end %> |
||||
|
||||
<% if current_user.data_coordinator? || current_user.support? %> |
||||
<%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> |
||||
<% end %> |
||||
<%= govuk_table do |table| %> |
||||
<%= table.caption(size: "s", classes: %w[govuk-!-text-align-left govuk-!-margin-top-4 govuk-!-margin-bottom-4]) do |caption| %> |
||||
<span class="govuk-!-margin-right-4"> |
||||
<strong><%= @pagy.count %></strong><span style="font-weight: normal"> total users</span> |
||||
</span> |
||||
<% end %> |
||||
<%= 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 %> |
||||
<% @users.each do |user| %> |
||||
<%= table.body do |body| %> |
||||
<%= body.row do |row| %> |
||||
<% row.cell(text: simple_format(user_cell(user), {}, wrapper_tag: "div")) %> |
||||
<% 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 %> |
||||
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "users" } %> |
Loading…
Reference in new issue