<commit_before><script>
jQuery(function(){
  $('#manifestation_original_title').auto_ruby($('#manifestation_title_transcription'))
  $('#manifestation_title_transcription').val("<%= @manifestation.title_transcription %>");//初回遷移時対策 

  var article_title = "<%= @manifestation.article_title %>"
  displayArticleTitle(article_title);
  $('#manifestation_manifestation_type_id').change(function () {
    article_title = ""
    displayArticleTitle(article_title);
  });
})

function displayArticleTitle(article_title) {
  var manifestation_type = $('#manifestation_manifestation_type_id').val();
  var series  = ['3', '4', '5', '6']; 
  var article = ['9', '10'];
  var pub_data_field = "<label class='pub_date' for='manifestation_pub_date'><%= t('activerecord.attributes.manifestation.pub_date')%></label>";

  if($.inArray(manifestation_type, article) != -1) {
    $("#article_title_field").show();
    pub_data_field = "<label class='pub_date' for='manifestation_pub_date'><%= t('activerecord.attributes.manifestation.pub_date_article')%></label>"
    $("#frequency_field").hide();
    $("#manifestation_frequency_id").val("17");
  } else if($.inArray(manifestation_type, series) != -1) {
    $("#frequency_field").show(); 
    $("#article_title_field").hide();
    $("#manifestation_article_title").val("");
  } else {
    $("#frequency_field").hide();
    $("#manifestation_frequency_id").val("17");
    $("#article_title_field").hide();
    $("#manifestation_article_title").val("");
  }
  $(".pub_date").html(pub_data_field);
}
$(document).keydown(function(e) {
  if (e.keyCode == 13) return false;
});
</script>

<%= render 'page/required_field' %>
<%#= simple_form_for(@manifestation, :html => { :multipart => true }) do |f| -%>
<%= form_for(@manifestation, :html => { :multipart => true }) do |f| -%>
  <%= f.error_messages -%>

  <div class="field">
    <%- if !@manifestation.new_record? and @manifestation.series_statement -%>
      <%= f.hidden_field :series_statement_id, :value => @manifestation.series_statement.id -%>
      <%= f.label t('activerecord.models.series_statement') -%>
      <%= link_to @manifestation.series_statement.original_title, @manifestation.series_statement -%>
      (<%= link_to t('series_statement.edit'), series_statements_path(:manifestation_id => @manifestation.id) -%>)
    <%- else -%> 
      <%= f.hidden_field :series_statement_id, :value => @manifestation.series_statement.id if @manifestation.series_statement-%>
      <%= f.label t('activerecord.models.series_statement') -%>
      <%= link_to @manifestation.series_statement.original_title, @manifestation.series_statement if @manifestation.series_statement -%>
      <% if @manifestation.new_record? %>
        (<%= link_to t('page.listing', :model => t('activerecord.models.series_statement')), series_statements_path -%>)
      <% else %>
        (<%= link_to t('page.listing', :model => t('activerecord.models.series_statement')), manifestation_series_statements_path(@manifestation) -%>)
      <%- end -%>
    <%- end -%>
  </div>

  <div class="field">
    <%= f.label :original_title -%><br />
    <%= f.text_field :original_title, :class => 'resource_title' -%>
  </div>
  <div class="field"><commit_msg>refs5191 資料の登録の改行不可の修正<commit_after><script>
jQuery(function(){
  $('#manifestation_original_title').auto_ruby($('#manifestation_title_transcription'))
  $('#manifestation_title_transcription').val("<%= @manifestation.title_transcription %>");//初回遷移時対策 

  var article_title = "<%= @manifestation.article_title %>"
  displayArticleTitle(article_title);
  $('#manifestation_manifestation_type_id').change(function () {
    article_title = ""
    displayArticleTitle(article_title);
  });
})

function displayArticleTitle(article_title) {
  var manifestation_type = $('#manifestation_manifestation_type_id').val();
  var series  = ['3', '4', '5', '6']; 
  var article = ['9', '10'];
  var pub_data_field = "<label class='pub_date' for='manifestation_pub_date'><%= t('activerecord.attributes.manifestation.pub_date')%></label>";

  if($.inArray(manifestation_type, article) != -1) {
    $("#article_title_field").show();
    pub_data_field = "<label class='pub_date' for='manifestation_pub_date'><%= t('activerecord.attributes.manifestation.pub_date_article')%></label>"
    $("#frequency_field").hide();
    $("#manifestation_frequency_id").val("17");
  } else if($.inArray(manifestation_type, series) != -1) {
    $("#frequency_field").show(); 
    $("#article_title_field").hide();
    $("#manifestation_article_title").val("");
  } else {
    $("#frequency_field").hide();
    $("#manifestation_frequency_id").val("17");
    $("#article_title_field").hide();
    $("#manifestation_article_title").val("");
  }
  $(".pub_date").html(pub_data_field);
}
$(document).keydown(function(e) {
  $("input[type=text]").keypress(function(ev) {
   if ((ev.which && ev.which === 13) ||
        (ev.keyCode && ev.keyCode === 13)) {
      return false;
    } else {
      return true;
    }
  });
});
</script>

<%= render 'page/required_field' %>
<%#= simple_form_for(@manifestation, :html => { :multipart => true }) do |f| -%>
<%= form_for(@manifestation, :html => { :multipart => true }) do |f| -%>
  <%= f.error_messages -%>

  <div class="field">
    <%- if !@manifestation.new_record? and @manifestation.series_statement -%>
      <%= f.hidden_field :series_statement_id, :value => @manifestation.series_statement.id -%>
      <%= f.label t('activerecord.models.series_statement') -%>
      <%= link_to @manifestation.series_statement.original_title, @manifestation.series_statement -%>
      (<%= link_to t('series_statement.edit'), series_statements_path(:manifestation_id => @manifestation.id) -%>)
    <%- else -%> 
      <%= f.hidden_field :series_statement_id, :value => @manifestation.series_statement.id if @manifestation.series_statement-%>
      <%= f.label t('activerecord.models.series_statement') -%>
      <%= link_to @manifestation.series_statement.original_title, @manifestation.series_statement if @manifestation.series_statement -%>
      <% if @manifestation.new_record? %>
        (<%= link_to t('page.listing', :model => t('activerecord.models.series_statement')), series_statements_path -%>)
      <% else %>
        (<%= link_to t('page.listing', :model => t('activerecord.models.series_statement')), manifestation_series_statements_path(@manifestation) -%>)
      <%- end -%>
    <%- end -%>
  </div>

  <div class="field">
    <%= f.label :original_title -%><br />
    <%= f.text_field :original_title, :class => 'resource_title' -%>
  </div>
  <div class="field">
{'fraction_non_alphanumeric': 0.1983922341877749, 'fraction_numerical': 0.005460336720764447, 'mean_word_length': 5.010938924339107, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 97, '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': '2751035', 'n_tokens_mistral': 2324, 'n_tokens_neox': 2150, 'n_words': 290}