<% priors = paper.prior_submissions %>
<% if priors.any? %>
  <div class="card border-warning">
    <div class="card-header bg-warning">
      Possible resubmission
    </div>
    <div class="card-body">
      <p class="card-text">
        <%= pluralize(priors.size, 'other paper') %> with the same repository address
        <% if paper.repository_url.present? %>
          (<%= link_to paper.repository_url, paper.repository_url, target: "_blank", rel: "noopener" %>)
        <% end %>:
      </p>
      <ul class="card-text">
        <% priors.each do |prior| %>
          <li>
            <%= link_to prior.title, prior.doi? ? prior.seo_url : paper_path(prior) %>
            &mdash; <strong><%= prior.pretty_state %></strong>
            <span class="text-muted">(submitted <%= prior.created_at.to_date.to_formatted_s(:long) %>)</span>
          </li>
        <% end %>
      </ul>
    </div>
  </div>
  <br />
<% end %>
