
<div class="container">
  <div class="row justify-content-lg-center">
    <div class="col-lg-9">
      <h1>Profile</h1>

      <%= render partial: "profiles_menu" %>

      <div class="generic-content-item">
        <p>Please make sure you've added an <strong>email address and GitHub username</strong> to your profile before submitting. We'll use this to communicate the status of your paper and you won't be able to submit a paper without giving us this information. We promise not to spam you. </p>
        <%= form_tag("/update_profile", id: "profile-form") do %>
        <div class="form-group">
          <label for="email">Email address</label>
          <%= email_field "user", "email", placeholder: "your.email@example.com", class: "form-control" %>
        </div>

        <div class="form-group">
          <label for="email">GitHub Username</label>
          <%= text_field "user", "github_username", placeholder: "@username", class: "form-control" %>
        </div>
        <div class="form-actions">
          <%= submit_tag("Update profile", class: "btn action-btn") %>
        </div>
        <% end %>
      </div>
    </div>
  </div>

  <div id ="row" class="paper-list">
    <% if current_user.papers.any? %>
      <h2>Your papers</h2>
      <% current_user.papers.each do |paper| %>
      <div class="paper-card">
        <div class="row">
          <div class="col-lg-9">
            <%= pretty_status_badge(paper) %> <%= time_words(paper) %>
            <h2 class="paper-title"><%= link_to paper.title, paper_path(paper) %>
              <!-- <span class="badge-lang">Python</span>-->
            </h2>
            <%# formatted_body(paper, 400) %>
          </div>
          <div class="col-lg-3 paper-meta">
            <div class="submitted_by">
              <%= link_to submittor_github(paper), target: "_blank" do %>
              <%= image_tag submittor_avatar(paper), size: "24x24" %>
              <%= paper.submitting_author.pretty_github_username %>
              <% end %>
            </div>
            <div class="doi">
              <% if paper.doi.blank? %>
              <%= image_tag 'doi.svg' %><%= link_to "Pending", paper_path(paper) %>
              <% else %>
              <%= image_tag 'doi.svg' %><%= link_to paper.doi, paper_path(paper) %>
              <% end %>
            </div>
          </div>
        </div>
      </div>
      <% end %>
    <% end %>
  </div>
</div>
