From ab1dd811bf94fd7c028f45115cbf4297c9e5253b Mon Sep 17 00:00:00 2001 From: JP <85654561+jp524@users.noreply.github.com> Date: Tue, 21 May 2024 16:07:39 -0500 Subject: [PATCH] Add 'Switch to' link in admin navbar --- app/views/layouts/_lte_admin_navbar.html.erb | 14 +++++++++++--- app/views/layouts/_lte_navbar.html.erb | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_lte_admin_navbar.html.erb b/app/views/layouts/_lte_admin_navbar.html.erb index be68d89385..5b46468b86 100644 --- a/app/views/layouts/_lte_admin_navbar.html.erb +++ b/app/views/layouts/_lte_admin_navbar.html.erb @@ -2,11 +2,19 @@ <%= current_user.display_name %> +
- \ No newline at end of file + diff --git a/app/views/layouts/_lte_navbar.html.erb b/app/views/layouts/_lte_navbar.html.erb index 006889d397..f90c40914d 100644 --- a/app/views/layouts/_lte_navbar.html.erb +++ b/app/views/layouts/_lte_navbar.html.erb @@ -69,7 +69,7 @@ <% current_user.switchable_roles.each do |role| %> <% next if role == current_role %> <%= link_to switch_to_role_users_path(role_id: role.id), class:"dropdown-item" do %> - <%= "Switch to: #{role.resource.name}" %> + <%= "Switch to: #{role.resource&.name || "Super Admin"}" %> <% end %> <% end %> <% if current_organization.id.present? &&