<commit_before><%
content_for :title, @user ? t('mails.post_from', name: @user) : t('mails.post')
content_for :h1, @user ? t('mails.post_from', name: @user) : t('mails.post')
content_for(:body_id, "mail-index")
content_for(:body_classes, 'mail index' + (@user ?  ' ' +  user_to_class_name(@user) : ''))
%>

<%= form_tag mails_path, class: 'form-horizontal', :method => :delete do %>

<table class="cf-default-table">
  <thead>
    <tr>
      <th><input type="checkbox" id="check-all-box">
      <th> </th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:sender), :sender, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:recipient), :recipient, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:subject), :subject, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:created_at), :created_at, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th> </th>
    </tr>
  </thead>

  <tbody>
    <% if @mails.blank? %>
      <tr class="no-data">
        <td colspan="7"><%= t('mails.no_mails') %></td>
      </tr>
    <% end %>

    <% @mails.each do |m| %>
    <tr>
      <td><input type="checkbox" name="ids[]" value="<%= m.priv_message_id %>" class="mid-checkbox"></td>
      <td class="unread-mark"><% unless m.is_read? %><span class="status-unread">&nbsp;</span><% end %></td>
      <td><%= cf_link_to (m.sender_id ? image_tag(m.sender.avatar(:thumb)) : '') + " " + m.sender_name, mail_path(m.sender_name, m) %></td>
      <td><%= cf_link_to (m.recipient_id ? image_tag(m.recipient.avatar(:thumb)) : '') + " " + m.recipient_name, mail_path(m.sender_name, m) %></td>
      <td><%= cf_link_to m.subject, mail_path(m.sender_name, m) %></td>
      <td><%= l(m.created_at, format: date_format) %></td>
      <td>
        <%= cf_link_to '', mail_path(m.sender_name, m), method: :delete, data: {confirm: t('global.are_you_sure')}, class: 'icon-delete-mail', title: t('mails.delete') %>

        <% if m.is_read? %>
          <%= cf_link_to '', mail_path(m.sender_name, m), method: :post, class: 'icon-mark-unread', title: t('mails.mark_unread') %>
        <% else %>
          <%= cf_link_to '', mail_path(m.sender_name, m), method: :post, class: 'icon-mark-read', title: t('mails.mark_read') %>
        <% end %>

        <% unless m.partner_id(current_user).blank? %>
          <%= cf_link_to '', new_mail_path('priv_message_id' => m.priv_message_id), class: 'icon-answer-mail-wo-quote', title: t('mails.answer_mail_wo_quote') %>
          <%= cf_link_to '', new_mail_path('priv_message_id' => m.priv_message_id, quote_old_message: 'yes'), class: 'icon-answer-mail', title: t('mails.answer_mail') %>
        <% end %>
      </td>
    </tr>
    <% end %>
  </tbody>

</table>

<p class="form-actions">
  <button class="cf-primary-btn" data-confirm="<%= t('global.are_you_sure') %>">Löschen</button>
</p>

<%= paginate @mails, params: { sort: sort_column, dir: sort_direction } %><commit_msg>ref: added a new mail link to mails list<commit_after><%
content_for :title, @user ? t('mails.post_from', name: @user) : t('mails.post')
content_for :h1, @user ? t('mails.post_from', name: @user) : t('mails.post')
content_for(:body_id, "mail-index")
content_for(:body_classes, 'mail index' + (@user ?  ' ' +  user_to_class_name(@user) : ''))
%>

<%= form_tag mails_path, class: 'form-horizontal', :method => :delete do %>

<table class="cf-default-table">
  <thead>
    <tr>
      <th><input type="checkbox" id="check-all-box">
      <th> </th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:sender), :sender, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:recipient), :recipient, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:subject), :subject, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th><%= sortable CfPrivMessage.human_attribute_name(:created_at), :created_at, lambda { |dir,col| index_mail_link(col, dir) } %></th>
      <th> </th>
    </tr>
  </thead>

  <tbody>
    <% if @mails.blank? %>
      <tr class="no-data">
        <td colspan="7"><%= t('mails.no_mails') %></td>
      </tr>
    <% end %>

    <% @mails.each do |m| %>
    <tr>
      <td><input type="checkbox" name="ids[]" value="<%= m.priv_message_id %>" class="mid-checkbox"></td>
      <td class="unread-mark"><% unless m.is_read? %><span class="status-unread">&nbsp;</span><% end %></td>
      <td><%= cf_link_to (m.sender_id ? image_tag(m.sender.avatar(:thumb)) : '') + " " + m.sender_name, mail_path(m.sender_name, m) %></td>
      <td><%= cf_link_to (m.recipient_id ? image_tag(m.recipient.avatar(:thumb)) : '') + " " + m.recipient_name, mail_path(m.sender_name, m) %></td>
      <td><%= cf_link_to m.subject, mail_path(m.sender_name, m) %></td>
      <td><%= l(m.created_at, format: date_format) %></td>
      <td>
        <%= cf_link_to '', mail_path(m.sender_name, m), method: :delete, data: {confirm: t('global.are_you_sure')}, class: 'icon-delete-mail', title: t('mails.delete') %>

        <% if m.is_read? %>
          <%= cf_link_to '', mail_path(m.sender_name, m), method: :post, class: 'icon-mark-unread', title: t('mails.mark_unread') %>
        <% else %>
          <%= cf_link_to '', mail_path(m.sender_name, m), method: :post, class: 'icon-mark-read', title: t('mails.mark_read') %>
        <% end %>

        <% unless m.partner_id(current_user).blank? %>
          <%= cf_link_to '', new_mail_path('priv_message_id' => m.priv_message_id), class: 'icon-answer-mail-wo-quote', title: t('mails.answer_mail_wo_quote') %>
          <%= cf_link_to '', new_mail_path('priv_message_id' => m.priv_message_id, quote_old_message: 'yes'), class: 'icon-answer-mail', title: t('mails.answer_mail') %>
          <%= cf_link_to('', new_mail_path(cf_priv_message: {recipient_id: m.partner_id(current_user)}),
                         class: 'icon-new-mail', title: t('mails.new_mail')) %>
        <% end %>
      </td>
    </tr>
    <% end %>
  </tbody>

</table>

<p class="form-actions">
  <button class="cf-primary-btn" data-confirm="<%= t('global.are_you_sure') %>">Löschen</button>
</p>

<%= paginate @mails, params: { sort: sort_column, dir: sort_direction } %>
{'fraction_non_alphanumeric': 0.21682797377458632, 'fraction_numerical': 0.0006244146113019045, 'mean_word_length': 3.8983180428134556, 'pattern_counts': {'":': 0, '<': 162, '<?xml version=': 0, '>': 168, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '219267', 'n_tokens_mistral': 2524, 'n_tokens_neox': 2370, 'n_words': 432}