diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 921953779..8592d9398 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -24,7 +24,7 @@ class OrganisationsController < ApplicationController @pagy, @users = pagy(filtered_users(@organisation.users.sorted_by_organisation_and_role, search_term)) @searched = search_term.presence @total_count = @organisation.users.size - render "users/index" + render "users", layout: "application" end def details diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb new file mode 100644 index 000000000..929e08081 --- /dev/null +++ b/app/views/organisations/users.html.erb @@ -0,0 +1,27 @@ +<% item_label = @pagy.count > 1 ? "users" : "user" %> +<% if @searched.present? %> + <% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %> +<% else %> + <% title = "Your organisation (User)" %> +<% end %> + +<% content_for :title, title %> + +<% content_for :tab_title do %> + <%= "Users" %> +<% end %> + +<%= render SubNavigationComponent.new( + items: secondary_items(request.path, @organisation.id), +) %> + +<% if current_user.data_coordinator? || current_user.support? %> + <%= govuk_button_link_to "Invite user", new_user_path, html: { method: :get } %> +<% end %> + +<%= render SearchComponent.new(current_user:, search_label: "Search by name or email address", value: @searched) %> + +