<div class="col-md-3 paper-sidebar">
  <div class="btn-group-vertical" role="group" aria-label="...">
    <% if @paper.is_a_retraction_notice?  %>
      <%= link_to @paper.pdf_url, class: 'btn paper-btn' do %>
        <%= image_tag "dl-icon.svg" %>
        Download Retraction Notice
      <% end %>

      <%= link_to @paper.retracted_paper.seo_url, class: 'btn paper-btn danger' do %>
        <%= image_tag "icon_docs.svg" %>
        Retracted Paper
      <% end %>
    <% else %>

      <% if @paper.retracted? && @paper.retraction_paper.present? %>
        <%= link_to @paper.retraction_paper.seo_url, class: 'btn paper-btn' do %>
          <%= image_tag "icon_docs.svg" %>
          Retraction notice
        <% end %>
      <% end %>
      <%= link_to  @paper.repository_url, class: 'btn paper-btn' do %>
        <%= image_tag "gh-icon.svg" %>
        Software repository
      <% end %>

      <%= link_to @paper.review_url, class: 'btn paper-btn' do %>
        <%= image_tag "icon_docs.svg" %>
        Paper review
      <% end %>

      <%= link_to @paper.seo_pdf_url, class: 'btn paper-btn' do %>
        <%= image_tag "dl-icon.svg" %>
        Download paper
      <% end %>

      <%= link_to @paper.archive_doi_url, class: 'btn paper-btn' do %>
        <%= image_tag "hist-icon.svg" %>
        Software archive
      <% end %>
    <% end %>
  </div>

  <% unless @paper.is_a_retraction_notice?  %>
    <div class="label">Review</div>
    <p>Editor: <%= github_link @paper.metadata_editor %> (<%= link_to "all papers", papers_by_editor_path(@paper.metadata_editor) %>)<br>Reviewers: <%= pretty_reviewers(@paper.metadata_reviewers) %></p>
  <% end %>

  <div class="label">Authors</div>
  <p><%= pretty_authors(@paper.metadata_authors) %></p>

  <div class="label">Citation</div>
  <p id="citationstring" style="padding-bottom: 0px;margin: 0px;"><%= @paper.citation_string %></p>

  <div id="bibtex" style="position:absolute;left:-10000px;height:0px;padding:0px;"><%= render partial: "bibtex", locals: { paper: @paper } %></div>
  <div style="margin-bottom: 10px;"><%= link_to "Copy citation string".html_safe, "#", class: "clipboard-btn", "data-clipboard-action": "copy", "data-clipboard-target": "#citationstring" %> &middot; <%= link_to "Copy BibTeX".html_safe, "#", class: "clipboard-btn", "data-clipboard-action": "copy", "data-clipboard-target": "#bibtex" %>&nbsp;&nbsp;<%= octicon "paste", height: 16,  class: "", "aria-label": "Copy" %></div>

  <div class="label">Tags</div>
  <p>
    <% @paper.author_tags.compact.each do |tag| %>
    <span class="badge-lang"><%= link_to tag, papers_by_tag_path(tag: tag) %></span>
    <% end %>
  </p>
  <div class="label">Altmetrics</div>
  <div style='padding-bottom: 10px;' data-badge-type='donut' class='altmetric-embed' data-badge-popover='right' data-hide-no-mentions='false' data-doi="<%= @paper.doi %>"></div>

  <div class="label">Markdown badge</div>
  <p><%= image_tag @paper.status_badge_url %> &nbsp; <a href="#" class="clipboard-btn" data-clipboard-text="<%= @paper.markdown_code %>"><%= octicon "paste", height: 16,  class: "", "aria-label": "Copy" %></a></p>

  <div class="label">License</div>
  <p>Authors of <%= Rails.application.settings['abbreviation'] %> papers retain copyright.</p>
  <p>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>
  <p><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a></p>
</div>
