diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 1d143d928..87b075e15 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -2,12 +2,8 @@ class OrganisationsController < ApplicationController before_action :authenticate_user! before_action :find_organisation - def details - render "_details" - end - def users - render "_users" + render "users" end private diff --git a/app/views/organisations/_details.html.erb b/app/views/organisations/_details.html.erb deleted file mode 100644 index 106d6316d..000000000 --- a/app/views/organisations/_details.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= 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 %> diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index 8715e3fd0..45eabf6e5 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -14,4 +14,11 @@ { name: t('Users'), url: users_organisation_path(@organisation) }, ]) %> -<%= render "details" %> +<%= 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 %> diff --git a/app/views/organisations/_users.html.erb b/app/views/organisations/users.html.erb similarity index 64% rename from app/views/organisations/_users.html.erb rename to app/views/organisations/users.html.erb index 0e18005e6..094036aa4 100644 --- a/app/views/organisations/_users.html.erb +++ b/app/views/organisations/users.html.erb @@ -1,3 +1,19 @@ +<% content_for :before_content do %> + <%= govuk_back_link( + text: 'Back', + href: :back, + ) %> +<% end %> + +

+ Your Organisation +

+ +<%= render TabNavigationComponent.new(items: [ + { name: t('Details'), url: details_organisation_path(@organisation) }, + { name: t('Users'), url: users_organisation_path(@organisation) }, +]) %> + <%= govuk_table do |table| %> <%= table.head do |head| %> <%= head.row do |row| diff --git a/config/routes.rb b/config/routes.rb index 7c16c0708..990942241 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,7 @@ Rails.application.routes.draw do resources :organisations do member do - get "details", to: "organisations#details" + get "details", to: "organisations#show" get "users", to: "organisations#users" end end