<commit_before><h1>Transfer of Ownership</h1>

<h2>Sent</h2>
<% if @outgoing.present? %>
  <table class="table table-striped" id="outgoing-transfers">
    <thead> 
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>To</th>
      <th>Status</th>
      <th>Comments</th>
    </tr>
    </thead> 
    <tbody> 
    <% @outgoing.each do |req| %>
      <tr>
        <td> <%= link_to req.solr_doc.title, sufia.generic_file_path(req['pid'].split(':').last) %> </td>
        <td class="sorts-dash">
          <% if req.created_at > Time.now.beginning_of_day %>
            <%= "#{time_ago_in_words(req.created_at)} ago"%>
          <% else %>
            <%= req.created_at.strftime("%b %d %Y") %>
          <% end %>
        </td>
        <td><%= link_to req.receiving_user.name, sufia.profile_path(req.receiving_user.login)  %></td>
        <td>
          <% if req.pending? %>
            <%= button_to "Cancel", transfer_path(req), method: :delete, class:'btn btn-danger', confirm: "Are you sure you want to cancel this request?" %>
          <% else %>
            <%= req.status.capitalize %>
          <% end %>
        </td>
        <td><%= req.sender_comment %></td>
      </tr>
    <% end %>
    </tbody> 
  </table>
<% else %>
  You haven't transferred any files.
<% end %>

<h2>Received</h2>
<% if @incoming.present? %>
  <table class="table table-striped" id="incoming-transfers">
    <thead> 
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>From</th>
      <th>Status</th>
      <th>Comments</th>
    </tr>
    </thead> 
    <tbody> 
    <% @incoming.each do |req| %>
      <tr>
        <td> <%= link_to req.solr_doc.title, sufia.generic_file_path(req['pid'].split(':').last) %> </td>
        <td class="sorts-dash">
          <% if req.created_at > Time.now.beginning_of_day %>
            <%= "#{time_ago_in_words(req.created_at)} ago"%>
          <% else %>
            <%= req.created_at.strftime("%b %d %Y") %>
          <% end %>
        </td>
        <td><%= link_to req.receiving_user.name, sufia.profile_path(req.receiving_user.login)  %></td>
        <td>
          <% if req.pending? %>
            <%= button_to "Accept", accept_transfer_path(req), method: :put, class: 'btn btn-primary' %>
            <%= button_to "Reject", reject_transfer_path(req), method: :put, class: 'btn btn-danger', confirm: "Are you sure you want to reject this request?" %>
          <% else %>
            <%= req.status.capitalize %>
          <% end %>
        </td>

        <td><%= req.sender_comment %></td>
      </tr>
    <% end %>
    </tbody> 
  </table>
<% else %>
  You haven't received any file transfer requests
<% end %><commit_msg>Transfers should list the sending user in the 'from' field, not the receiving user: fixes #3884<commit_after><h1>Transfer of Ownership</h1>

<h2>Sent</h2>
<% if @outgoing.present? %>
  <table class="table table-striped" id="outgoing-transfers">
    <thead> 
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>To</th>
      <th>Status</th>
      <th>Comments</th>
    </tr>
    </thead> 
    <tbody> 
    <% @outgoing.each do |req| %>
      <tr>
        <td> <%= link_to req.solr_doc.title, sufia.generic_file_path(req['pid'].split(':').last) %> </td>
        <td class="sorts-dash">
          <% if req.created_at > Time.now.beginning_of_day %>
            <%= "#{time_ago_in_words(req.created_at)} ago"%>
          <% else %>
            <%= req.created_at.strftime("%b %d %Y") %>
          <% end %>
        </td>
        <td><%= link_to req.receiving_user.name, sufia.profile_path(req.receiving_user.login)  %></td>
        <td>
          <% if req.pending? %>
            <%= button_to "Cancel", transfer_path(req), method: :delete, class:'btn btn-danger', confirm: "Are you sure you want to cancel this request?" %>
          <% else %>
            <%= req.status.capitalize %>
          <% end %>
        </td>
        <td><%= req.sender_comment %></td>
      </tr>
    <% end %>
    </tbody> 
  </table>
<% else %>
  You haven't transferred any files.
<% end %>

<h2>Received</h2>
<% if @incoming.present? %>
  <table class="table table-striped" id="incoming-transfers">
    <thead> 
    <tr>
      <th>Title</th>
      <th>Date</th>
      <th>From</th>
      <th>Status</th>
      <th>Comments</th>
    </tr>
    </thead> 
    <tbody> 
    <% @incoming.each do |req| %>
      <tr>
        <td> <%= link_to req.solr_doc.title, sufia.generic_file_path(req['pid'].split(':').last) %> </td>
        <td class="sorts-dash">
          <% if req.created_at > Time.now.beginning_of_day %>
            <%= "#{time_ago_in_words(req.created_at)} ago"%>
          <% else %>
            <%= req.created_at.strftime("%b %d %Y") %>
          <% end %>
        </td>
        <td><%= link_to req.sending_user.name, sufia.profile_path(req.sending_user.login)  %></td>
        <td>
          <% if req.pending? %>
            <%= button_to "Accept", accept_transfer_path(req), method: :put, class: 'btn btn-primary' %>
            <%= button_to "Reject", reject_transfer_path(req), method: :put, class: 'btn btn-danger', confirm: "Are you sure you want to reject this request?" %>
          <% else %>
            <%= req.status.capitalize %>
          <% end %>
        </td>

        <td><%= req.sender_comment %></td>
      </tr>
    <% end %>
    </tbody> 
  </table>
<% else %>
  You haven't received any file transfer requests
<% end %>
{'fraction_non_alphanumeric': 0.19448556624722427, 'fraction_numerical': 0.0029607698001480384, 'mean_word_length': 2.175675675675676, 'pattern_counts': {'":': 0, '<': 209, '<?xml version=': 0, '>': 213, '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': '5196707', 'n_tokens_mistral': 2069, 'n_tokens_neox': 1870, 'n_words': 371}