123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <% if user_masquerade? %>
- <div class="alert alert-warning text-center">
- You're logged in as <b><%= current_user.name %> (<%= current_user.email %>)</b>
- <%= link_to back_masquerade_path(current_user) do %><%= icon("times") %> Logout <% end %>
- </div>
- <% end %>
- <nav class="navbar navbar-expand-md navbar-light bg-light">
- <div class="container">
- <%= link_to Rails.configuration.application_name, root_path, class: "navbar-brand" %>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMain" aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarMain">
- <ul class="navbar-nav mr-auto mt-2 mt-md-0">
- </ul>
- <ul class="navbar-nav">
- <li class="nav-item"><%= link_to "What's New", announcements_path, class: "nav-link #{unread_announcements(current_user)}" %></li>
- <% if user_signed_in? %>
- <li class="nav-item">
- <%= link_to notifications_path, class: "nav-link" do %>
- <span><i class="fa fa-flag-o" aria-hidden="true"></i></span>
- <% end %>
- </li>
- <li class="nav-item dropdown">
- <%= link_to root_path, id: "navbar-dropdown", class: "nav-link dropdown-toggle", data: { toggle: "dropdown" }, aria: { haspopup: true, expanded: false } do %>
- <%= image_tag gravatar_image_url(current_user.email, size: 40), height: 20, width: 20, class: "rounded" %>
- <% end %>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbar-dropdown">
- <% if current_user.admin? %>
- <%= link_to "Admin Area", admin_root_path, class: "dropdown-item" %>
- <% end %>
- <%= link_to "Settings", edit_user_registration_path, class: "dropdown-item" %>
- <div class="dropdown-divider"></div>
- <%= link_to "Logout", destroy_user_session_path, method: :delete, class: "dropdown-item" %>
- </div>
- </li>
- <% else %>
- <li class="nav-item"><%= link_to "Sign Up", new_user_registration_path, class: "nav-link" %></li>
- <li class="nav-item"><%= link_to "Login", new_user_session_path, class: "nav-link" %></li>
- <% end %>
- </ul>
- </div>
- </div>
- </nav>
|