<commit_before><div class="panel panel-default">
  <div class="panel-heading panel-title" id="api_key" data-api_key="<%= current_user && current_user.api_key %>" data-pid="<%= @work.pid %>" data-page="<%= @page %>" data-per_page="15" data-source_id="<%= @source.present? ? @source.name : "" %>" data-relation_type_id="<%= @relation_type.present? ? @relation_type.name : "" %>" data-sort="">
    <% if can?(:manage, Work) && controller.action_name != "edit" && !(controller.action_name == "update" && !@work.errors.empty?) %>
      <div class="btn-toolbar pull-right">
        <div class="btn-group btn-group-sm">
          <%= link_to icon("pencil").html_safe, edit_work_path(@work), { :remote => true, :class => 'btn btn-default' } %>
        </div>
        <div class="btn-group btn-group-sm">
          <%= link_to icon("trash").html_safe, work_path(@work), :data => { :confirm => 'Are you sure?' }, :method => :delete, :class => 'btn btn-default' %>
        </div>
        </div>
    <% end %>
    <%= @work.title.html_safe %>
  </div>
  <div class="panel-body">
    <% if can?(:manage, Work) && (controller.action_name == "edit" || (controller.action_name == "update" && !@work.errors.empty?)) %>
      <%= simple_form_for @work, :url => work_path(@work), :html => { :role => "form", :remote => true } do |f| %>
        <%= f.input :title, :input_html => { :rows => 2 } %>
        <%= f.input :doi, :label => 'DOI', :disabled => @work.pid_type == "doi" %>
        <%= f.input :canonical_url, :label => 'Canonical URL', :disabled => @work.pid_type == "url" %>
        <%= f.input :pmid, :label => 'PubMed', :disabled => @work.pid_type == "pmid" %>
        <%= f.input :pmcid, :label => 'PubMed Central', :disabled => @work.pid_type == "pmcid" %>
        <%= f.input :wos, :label => 'ArXiV', :disabled => @work.pid_type == "arxiv" %>
        <%= f.input :wos, :label => 'Web of Science', :disabled => @work.pid_type == "wos" %>
        <%= f.input :scp, :label => 'Scopus', :disabled => @work.pid_type == "scp" %>
        <%= f.input :ark, :label => 'Ark', :disabled => @work.pid_type == "ark" %>
        <%= f.input :tracked, :as => :boolean, hint: "Collect metrics for this work" %>
        <%= f.association :work_type, collection: WorkType.order("title").map { |work_type| [work_type.title, work_type.id] }, :include_blank => false %>
        <% if publishers.length > 1 %>
          <%= f.association :publisher, collection: Publisher.order("title").map { |publisher| [publisher.title, publisher.member_id] }, input_html: { class: "form-user" } %>
        <% end %>
        <%= f.input :published_on, label: "Publication Date" do %>
          <%= f.input_field :day, as: :day %>
          <%= f.input_field :month, as: :month %>
          <%= f.input_field :year, as: :year %>
        <% end %>

        <div class="form-group">
          <%= f.submit "Save ", class: "btn btn-default" %>
          <%= link_to 'Cancel', work_path(@work), { :remote => true, :class => 'btn' } %>
        </div>
      <% end %>
    <% else %>
      <dl class="dl-horizontal">
        <dt>Publication Date</dt>
        <dd><%= l @work.published_on, format: date_format(@work) %></dd>
        <% if @work.work_type && @work.work_type.name != "article-journal" %>
          <dt>Type</dt>
          <dd><%= @work.work_type.title %></dd>
        <% end %>
        <% if @work.container_title.present? %>
          <% if @work.work_type && @work.work_type.container %>
            <dt><%= h(@work.work_type.container) %></dt>
          <% else %>
            <dt>Container Title</dt>
          <% end %>
          <dd><%= h(@work.container_title) %></dd>
        <% end %>
        <% if publishers.length > 1 && @work.publisher %>
          <dt>Publisher</dt>
          <dd><%= link_to h(@work.publisher.title), publisher_path(@work.publisher.member_id) %></dd>
        <% end %>
        <% if @work.author.present? %>
          <dt><%= "Author".pluralize(@work.author.length) %></dt>
          <dd><%= author_format(@work.author).html_safe %></dd>
        <% end %>
        <% if @work.volume.present? %>
          <dt>Volume</dt>
          <dd><%= h(@work.volume) %></dd>
        <% end %>
        <% if @work.issue.present? %>
          <dt>Issue</dt>
          <dd><%= h(@work.issue) %></dd>
        <% end %>
        <% if @work.page.present? %>
          <dt>Pages</dt>
          <dd><%= h(@work.page) %></dd>
        <% end %>
        <% if @work.doi.present? %>
          <dt>DOI</dt>
          <dd class="doi" %><%= link_to h(@work.doi), @work.doi_as_url %></dd>
        <% end %>
        <% if @work.canonical_url.present? %>
          <dt>Publisher URL</dt>
          <dd><%= link_to h(@work.canonical_url), @work.canonical_url %></dd>
        <% end %>
        <% if @work.pmid.present? %>
          <dt>PubMed</dt>
          <dd id="pmid" data-pmid="<%= @work.pmid %>"><%= link_to @work.pmid, @work.pmid_as_url %></dd>
        <% end %>
        <% if @work.pmcid.present? %>
          <dt>PubMed Central</dt>
          <dd id="pmcid" data-pmcid="<%= @work.pmcid %>"><%= link_to "PMC#{@work.pmcid}", @work.pmcid_as_url %></dd>
        <% end %>
        <% if @work.pmid.present? %>
          <dt>Europe PMC</dt>
          <dd><%= link_to h(@work.pmid_as_europepmc_url), @work.pmid_as_europepmc_url %></dd>
        <% end %>
        <% if @work.wos.present? && @work.wos_url.present? %>
          <dt>Web of Science</dt>
          <dd><%= link_to @work.wos, @work.wos_url %></dd>
        <% end %>
        <% if @work.scp.present? && @work.scopus_url.present? %>
          <dt>Scopus</dt>
          <dd><%= link_to @work.scp, @work.scopus_url %></dd>
        <% end %>
        <% if @work.ark.present? %>
          <dt>Ark</dt>
          <dd><%= link_to @work.ark, @work.ark_as_url %></dd>
        <% end %>
        <% if @work.mendeley_url.present? %>
          <dt>Mendeley</dt>
          <dd><%= link_to @work.mendeley_url, @work.mendeley_url %></dd>
        <% end %>
        <% if @work.version_relations.present? %>
          <% @work.version_relations.each do |relation| %>
            <dt>relation.relation_type.title</dt>
            <dd><%= link_to relation.related_work.pid, work_url(relation.related_work.pid) %></dd>
          <% end %>
        <% end %>
      </dl>
    <% end %>
  </div>
</div>

<% if @work.tracked %>
  <% if can?(:read, Alert) %>
    <div id="alert-error-message">
      <%= render :partial => 'alert_message' %>
    </div>
  <% end %>
<% end %>

<ul class="nav nav-pills">
  <li class="active"><a href="#references" data-toggle="tab" title="References">References</a></li>
  <% if @work.tracked %>
    <li><a href="#events" data-toggle="tab" title="Events">Events</a></li>
    <li><a href="#more" data-toggle="tab" title="More">Details</a></li>
    <% if can?(:read, Alert) %>
      <li><a href="#alert" data-toggle="tab" title="Alerts">Alerts</a></li>
    <% end %>
  <% end %>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="references"><commit_msg>show title for version relation_type. #296<commit_after><div class="panel panel-default">
  <div class="panel-heading panel-title" id="api_key" data-api_key="<%= current_user && current_user.api_key %>" data-pid="<%= @work.pid %>" data-page="<%= @page %>" data-per_page="15" data-source_id="<%= @source.present? ? @source.name : "" %>" data-relation_type_id="<%= @relation_type.present? ? @relation_type.name : "" %>" data-sort="">
    <% if can?(:manage, Work) && controller.action_name != "edit" && !(controller.action_name == "update" && !@work.errors.empty?) %>
      <div class="btn-toolbar pull-right">
        <div class="btn-group btn-group-sm">
          <%= link_to icon("pencil").html_safe, edit_work_path(@work), { :remote => true, :class => 'btn btn-default' } %>
        </div>
        <div class="btn-group btn-group-sm">
          <%= link_to icon("trash").html_safe, work_path(@work), :data => { :confirm => 'Are you sure?' }, :method => :delete, :class => 'btn btn-default' %>
        </div>
        </div>
    <% end %>
    <%= @work.title.html_safe %>
  </div>
  <div class="panel-body">
    <% if can?(:manage, Work) && (controller.action_name == "edit" || (controller.action_name == "update" && !@work.errors.empty?)) %>
      <%= simple_form_for @work, :url => work_path(@work), :html => { :role => "form", :remote => true } do |f| %>
        <%= f.input :title, :input_html => { :rows => 2 } %>
        <%= f.input :doi, :label => 'DOI', :disabled => @work.pid_type == "doi" %>
        <%= f.input :canonical_url, :label => 'Canonical URL', :disabled => @work.pid_type == "url" %>
        <%= f.input :pmid, :label => 'PubMed', :disabled => @work.pid_type == "pmid" %>
        <%= f.input :pmcid, :label => 'PubMed Central', :disabled => @work.pid_type == "pmcid" %>
        <%= f.input :wos, :label => 'ArXiV', :disabled => @work.pid_type == "arxiv" %>
        <%= f.input :wos, :label => 'Web of Science', :disabled => @work.pid_type == "wos" %>
        <%= f.input :scp, :label => 'Scopus', :disabled => @work.pid_type == "scp" %>
        <%= f.input :ark, :label => 'Ark', :disabled => @work.pid_type == "ark" %>
        <%= f.input :tracked, :as => :boolean, hint: "Collect metrics for this work" %>
        <%= f.association :work_type, collection: WorkType.order("title").map { |work_type| [work_type.title, work_type.id] }, :include_blank => false %>
        <% if publishers.length > 1 %>
          <%= f.association :publisher, collection: Publisher.order("title").map { |publisher| [publisher.title, publisher.member_id] }, input_html: { class: "form-user" } %>
        <% end %>
        <%= f.input :published_on, label: "Publication Date" do %>
          <%= f.input_field :day, as: :day %>
          <%= f.input_field :month, as: :month %>
          <%= f.input_field :year, as: :year %>
        <% end %>

        <div class="form-group">
          <%= f.submit "Save ", class: "btn btn-default" %>
          <%= link_to 'Cancel', work_path(@work), { :remote => true, :class => 'btn' } %>
        </div>
      <% end %>
    <% else %>
      <dl class="dl-horizontal">
        <dt>Publication Date</dt>
        <dd><%= l @work.published_on, format: date_format(@work) %></dd>
        <% if @work.work_type && @work.work_type.name != "article-journal" %>
          <dt>Type</dt>
          <dd><%= @work.work_type.title %></dd>
        <% end %>
        <% if @work.container_title.present? %>
          <% if @work.work_type && @work.work_type.container %>
            <dt><%= h(@work.work_type.container) %></dt>
          <% else %>
            <dt>Container Title</dt>
          <% end %>
          <dd><%= h(@work.container_title) %></dd>
        <% end %>
        <% if publishers.length > 1 && @work.publisher %>
          <dt>Publisher</dt>
          <dd><%= link_to h(@work.publisher.title), publisher_path(@work.publisher.member_id) %></dd>
        <% end %>
        <% if @work.author.present? %>
          <dt><%= "Author".pluralize(@work.author.length) %></dt>
          <dd><%= author_format(@work.author).html_safe %></dd>
        <% end %>
        <% if @work.volume.present? %>
          <dt>Volume</dt>
          <dd><%= h(@work.volume) %></dd>
        <% end %>
        <% if @work.issue.present? %>
          <dt>Issue</dt>
          <dd><%= h(@work.issue) %></dd>
        <% end %>
        <% if @work.page.present? %>
          <dt>Pages</dt>
          <dd><%= h(@work.page) %></dd>
        <% end %>
        <% if @work.doi.present? %>
          <dt>DOI</dt>
          <dd class="doi" %><%= link_to h(@work.doi), @work.doi_as_url %></dd>
        <% end %>
        <% if @work.canonical_url.present? %>
          <dt>Publisher URL</dt>
          <dd><%= link_to h(@work.canonical_url), @work.canonical_url %></dd>
        <% end %>
        <% if @work.pmid.present? %>
          <dt>PubMed</dt>
          <dd id="pmid" data-pmid="<%= @work.pmid %>"><%= link_to @work.pmid, @work.pmid_as_url %></dd>
        <% end %>
        <% if @work.pmcid.present? %>
          <dt>PubMed Central</dt>
          <dd id="pmcid" data-pmcid="<%= @work.pmcid %>"><%= link_to "PMC#{@work.pmcid}", @work.pmcid_as_url %></dd>
        <% end %>
        <% if @work.pmid.present? %>
          <dt>Europe PMC</dt>
          <dd><%= link_to h(@work.pmid_as_europepmc_url), @work.pmid_as_europepmc_url %></dd>
        <% end %>
        <% if @work.wos.present? && @work.wos_url.present? %>
          <dt>Web of Science</dt>
          <dd><%= link_to @work.wos, @work.wos_url %></dd>
        <% end %>
        <% if @work.scp.present? && @work.scopus_url.present? %>
          <dt>Scopus</dt>
          <dd><%= link_to @work.scp, @work.scopus_url %></dd>
        <% end %>
        <% if @work.ark.present? %>
          <dt>Ark</dt>
          <dd><%= link_to @work.ark, @work.ark_as_url %></dd>
        <% end %>
        <% if @work.mendeley_url.present? %>
          <dt>Mendeley</dt>
          <dd><%= link_to @work.mendeley_url, @work.mendeley_url %></dd>
        <% end %>
        <% if @work.version_relations.present? %>
          <% @work.version_relations.each do |relation| %>
            <dt><%= relation.relation_type.title %></dt>
            <dd><%= link_to relation.related_work.pid, work_url(relation.related_work.pid) %></dd>
          <% end %>
        <% end %>
      </dl>
    <% end %>
  </div>
</div>

<% if @work.tracked %>
  <% if can?(:read, Alert) %>
    <div id="alert-error-message">
      <%= render :partial => 'alert_message' %>
    </div>
  <% end %>
<% end %>

<ul class="nav nav-pills">
  <li class="active"><a href="#references" data-toggle="tab" title="References">References</a></li>
  <% if @work.tracked %>
    <li><a href="#events" data-toggle="tab" title="Events">Events</a></li>
    <li><a href="#more" data-toggle="tab" title="More">Details</a></li>
    <% if can?(:read, Alert) %>
      <li><a href="#alert" data-toggle="tab" title="Alerts">Alerts</a></li>
    <% end %>
  <% end %>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="references">
{'fraction_non_alphanumeric': 0.2264567602222539, 'fraction_numerical': 0.000926057842997578, 'mean_word_length': 2.4948966890714463, 'pattern_counts': {'":': 0, '<': 440, '<?xml version=': 0, '>': 510, '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': '495311', 'n_tokens_mistral': 5324, 'n_tokens_neox': 4882, 'n_words': 918}