1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <% 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-toggleable-md navbar-light bg-faded">
- <div class="container">
- <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <%= link_to "Spark", root_path, class: "navbar-brand" %>
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <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 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>
|