<%- title t('conversations.conversation_list_title') %>

<h2><%= t('conversations.conversation_list_title') %></h2>

<% if @conversations.any? %>
  <ul>
    <% @conversations.each do |conversation| %>
      <li>
        <% other_users = (conversation.users - [@user]) %>
        <%= link_to t('conversations.conversation_link_html', users: other_users.map{ |u| render_user_text(u, nil) }.to_sentence, count: other_users.count), conversation.latest_path(@user, locale: request_locale) %>
        <%= t('conversations.conversation_info_html', date: markup_date(conversation.stat_last_message_date), user: render_user(conversation.stat_last_poster, conversation.stat_last_poster_id)) %>
      </li>
    <% end %>
  </ul>
<% else %>
  <p>
    <%= t('conversations.no_conversations') %>
  </p>
<% end %>

<p>
  <%= link_to t('conversations.new_link'), new_user_conversation_path(@user) %>
</p>

<%= render_pagination %>
