<% content_for :head do %>
  <%= javascript_include_tag "messages" %>
<% end %>

<% content_for :heading_class, "pb-0" %>

<% content_for :heading do %>
  <h1><%= t("users.show.my messages") %></h1>

  <ul class="nav nav-tabs">
    <li class="nav-item">
      <%= link_to t(".my_inbox"), inbox_messages_path, :class => "nav-link" %>
    </li>
    <li class="nav-item">
      <a class="nav-link active"><%= t ".my_outbox" %></a>
    </li>
  </ul>
<% end %>

<h4><%= t ".messages", :count => current_user.sent_messages.size %></h4>

<% if current_user.sent_messages.size > 0 %>
  <table class="table table-sm">
    <thead>
      <tr>
        <th><%= t ".to" %></th>
        <th><%= t ".subject" %></th>
        <th><%= t ".date" %></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <%= render :partial => "sent_message_summary", :collection => current_user.sent_messages %>
    </tbody>
  </table>
<% else %>
  <div class="messages"><%= t(".no_sent_messages_html", :people_mapping_nearby_link => link_to(t(".people_mapping_nearby"), user_path(current_user))) %></div>
<% end %>
