<%= link_to "School Platform", root_path, class: "navbar-brand" %>
  • <%= fa_icon "envelope fw" %> <% count = unread_messages_count current_user %> <% if count > 0 %> (<%= count %>) <% end %> <%= fa_icon "caret-down" %>
      <% for conversation in current_user.conversations.sort_by{ |conversation| conversation.messages.last.created_at }[0..1] %> <% message = conversation.messages.last %>
    • <%= link_to "#{conversation_path conversation}#message-#{message.id}" do %>
      <%= time_ago_in_words(message.created_at) %> ago <%= message.user.name %>
      <%= truncate(message.content, length: 100) %>
      <% end %>
    • <% end %>
    • <%= link_to conversations_path, class: 'text-center' do %> Read All Messages <%= fa_icon("angle-right") %> <% end %>
  • <%= fa_icon "user fw" %><%= fa_icon "caret-down" %>
    • <%= link_to fa_icon("user fw", text: "User Profile"), current_user %>
    • <%= link_to fa_icon("gear fw", text: "Settings"), edit_user_path(current_user) %>
    • <%= link_to fa_icon("sign-out fw", text: "Logout"), logout_path, method: :delete %>
  • <%= link_to fa_icon("home fw", text: "Home"), home_path %>
  • <%= link_to fa_icon("envelope fw", text: "Conversations"), conversations_path %>
  • <% for school in (current_user.schools_administering + [current_user.school]).uniq.compact do %>
  • <%= link_to fa_icon("building fw", text: school.name), school_path(school) %>
  • <% end %>
  • <%= link_to fa_icon("book fw", text: "Courses"), courses_user_path(current_user) %>