Skip to content

Commit

Permalink
Prepare admin navbar for "Switch to" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jp524 committed May 22, 2024
1 parent 460b66d commit c5eaa21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 39 deletions.
47 changes: 12 additions & 35 deletions app/views/layouts/_lte_admin_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-bs-toggle="dropdown">
<span class="hidden-xs"><%= current_user.display_name %></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-body">
<p class="text-center">
<b><%= current_user.display_name %></b>
</p>
</li>
<!-- Menu Body -->
<li class="user-body">
<ul class="list-group">
<li class="list-group-item">
<%= fa_icon "cog" %> <%= navigation_link_to "Account Settings", edit_user_registration_path %>
</li>
</ul>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<!-- <a href="#" class="btn btn-default btn-flat">Profile</a> -->
</div>
<div class="pull-right">
<%= delete_button_to destroy_user_session_path, {text: "Log out", icon: "sign-out", no_confirm: true, size: "md"} %>
</div>
</li>
</ul>
</li>
</ul>
</div>
<li class="nav-item dropdown">
<a class="nav-link" data-bs-toggle="dropdown" href="#">
<%= current_user.display_name %>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<%= link_to "Switch To: to be implemented", "#", class:"dropdown-item" %>
<div class="dropdown-divider"></div>
<%= link_to destroy_user_session_path, class:"dropdown-item dropdown-footer", method: :delete do %>
<i class="fa fa-sign-out mr-2"></i> Log Out
<% end %>
</div>
</li>
8 changes: 4 additions & 4 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
</a>

<ul class="navbar-nav ml-auto">
<% if user_signed_in? && current_organization.present? %>
<% if admin_namespace? %>
<%= render partial: "layouts/lte_admin_navbar" %>
<% else %>
<% if user_signed_in? %>
<% if current_organization.present? %>
<%= render partial: "layouts/lte_navbar" %>
<% elsif user_signed_in? && admin_namespace? %>
<%= render partial: "layouts/lte_admin_navbar" %>
<% end %>
<% else %>
<div class="navbar-custom-menu">
Expand Down

0 comments on commit c5eaa21

Please sign in to comment.