From 060a3e94b1d3e6d9ec797f9dd41dff0cc9306b4c Mon Sep 17 00:00:00 2001 From: Ben R Date: Sun, 24 Sep 2023 13:22:04 -0700 Subject: [PATCH 1/5] add route, controller, and view --- app/controllers/organizations/dashboard_controller.rb | 7 +++++++ app/views/organizations/dashboard/index.html.erb | 0 config/routes.rb | 1 + 3 files changed, 8 insertions(+) create mode 100644 app/controllers/organizations/dashboard_controller.rb create mode 100644 app/views/organizations/dashboard/index.html.erb diff --git a/app/controllers/organizations/dashboard_controller.rb b/app/controllers/organizations/dashboard_controller.rb new file mode 100644 index 000000000..2b8fa3d7d --- /dev/null +++ b/app/controllers/organizations/dashboard_controller.rb @@ -0,0 +1,7 @@ +class Organizations::DashboardController < Organizations::BaseController + before_action :verified_staff + + def index + + end +end \ No newline at end of file diff --git a/app/views/organizations/dashboard/index.html.erb b/app/views/organizations/dashboard/index.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/routes.rb b/config/routes.rb index 124692190..bc05645f3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,7 @@ scope module: :organizations do resources :home, only: [:index] resources :pets + resources :dashboard end resources :profile_reviews, only: [:show] From 1d4d51dc1facd14370b686556b80fcbd8a228b9c Mon Sep 17 00:00:00 2001 From: Ben R Date: Sun, 24 Sep 2023 15:35:45 -0700 Subject: [PATCH 2/5] render footer optionally on org pages and add start of dashboard UI --- .../organizations/dashboard_controller.rb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/layouts/shared/_navbar.html.erb | 9 +- .../organizations/dashboard/index.html.erb | 104 ++++++++++++++++++ 4 files changed, 108 insertions(+), 9 deletions(-) diff --git a/app/controllers/organizations/dashboard_controller.rb b/app/controllers/organizations/dashboard_controller.rb index 2b8fa3d7d..751670fab 100644 --- a/app/controllers/organizations/dashboard_controller.rb +++ b/app/controllers/organizations/dashboard_controller.rb @@ -2,6 +2,6 @@ class Organizations::DashboardController < Organizations::BaseController before_action :verified_staff def index - + @hide_footer = true end end \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4f7295338..e99547de6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -30,7 +30,7 @@ <% if Current.tenant.present? %> - <%= render partial: "layouts/shared/footer" %> + <%= render partial: "layouts/shared/footer" unless @hide_footer %> <% else %> <%= render partial: "layouts/shared/no_tenant_footer" %> <% end %> diff --git a/app/views/layouts/shared/_navbar.html.erb b/app/views/layouts/shared/_navbar.html.erb index 6c35e3fc8..b27bac51e 100644 --- a/app/views/layouts/shared/_navbar.html.erb +++ b/app/views/layouts/shared/_navbar.html.erb @@ -49,13 +49,8 @@ <% end %> <% if current_user.staff_account && current_user.staff_account.verified %>
  • - <%= link_to pets_path, class: 'dropdown-item' do %> - Our Pets - <% end %> -
  • -
  • - <%= link_to adopter_applications_path, class: 'dropdown-item' do %> - Applications + <%= link_to dashboard_index_path, class: 'dropdown-item' do %> + Dashboard <% end %>
  • <% end %> diff --git a/app/views/organizations/dashboard/index.html.erb b/app/views/organizations/dashboard/index.html.erb index e69de29bb..0aeb5a724 100644 --- a/app/views/organizations/dashboard/index.html.erb +++ b/app/views/organizations/dashboard/index.html.erb @@ -0,0 +1,104 @@ + + From 842e42c42ef3376a64fe9fb0539a8238cae2f6b5 Mon Sep 17 00:00:00 2001 From: Ben R Date: Sun, 24 Sep 2023 16:02:31 -0700 Subject: [PATCH 3/5] lint fix --- app/controllers/organizations/dashboard_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/organizations/dashboard_controller.rb b/app/controllers/organizations/dashboard_controller.rb index 751670fab..2a1e4c750 100644 --- a/app/controllers/organizations/dashboard_controller.rb +++ b/app/controllers/organizations/dashboard_controller.rb @@ -2,6 +2,6 @@ class Organizations::DashboardController < Organizations::BaseController before_action :verified_staff def index - @hide_footer = true + @hide_footer = true end -end \ No newline at end of file +end From 63ec924c3ba83c073de65e91697668bb72611401 Mon Sep 17 00:00:00 2001 From: Ben R Date: Sun, 24 Sep 2023 19:14:33 -0700 Subject: [PATCH 4/5] move navbar to a partial --- .../organizations/dashboard/_navbar.html.erb | 104 +++++++++++++++++ .../organizations/dashboard/index.html.erb | 105 +----------------- 2 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 app/views/organizations/dashboard/_navbar.html.erb diff --git a/app/views/organizations/dashboard/_navbar.html.erb b/app/views/organizations/dashboard/_navbar.html.erb new file mode 100644 index 000000000..0aeb5a724 --- /dev/null +++ b/app/views/organizations/dashboard/_navbar.html.erb @@ -0,0 +1,104 @@ + + diff --git a/app/views/organizations/dashboard/index.html.erb b/app/views/organizations/dashboard/index.html.erb index 0aeb5a724..236cb77f5 100644 --- a/app/views/organizations/dashboard/index.html.erb +++ b/app/views/organizations/dashboard/index.html.erb @@ -1,104 +1 @@ - - +<%= render 'organizations/dashboard/navbar' %> From 80964e700436b80f7c52d780fe3f0d20ba383a29 Mon Sep 17 00:00:00 2001 From: Ben R Date: Sun, 24 Sep 2023 19:24:28 -0700 Subject: [PATCH 5/5] move navbar into a partial and set up a dashboard layout template to render navbar and the appropriate template --- app/views/organizations/dashboard/_navbar.html.erb | 1 + app/views/organizations/dashboard/index.html.erb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/organizations/dashboard/_navbar.html.erb b/app/views/organizations/dashboard/_navbar.html.erb index 0aeb5a724..35d2b48ed 100644 --- a/app/views/organizations/dashboard/_navbar.html.erb +++ b/app/views/organizations/dashboard/_navbar.html.erb @@ -102,3 +102,4 @@ + \ No newline at end of file diff --git a/app/views/organizations/dashboard/index.html.erb b/app/views/organizations/dashboard/index.html.erb index 236cb77f5..81932aa6c 100644 --- a/app/views/organizations/dashboard/index.html.erb +++ b/app/views/organizations/dashboard/index.html.erb @@ -1 +1,4 @@ -<%= render 'organizations/dashboard/navbar' %> +
    + <%= render 'organizations/dashboard/navbar' %> + <%= yield :dashboard_content %> +
    \ No newline at end of file