<commit_before><%-
  unless defined?(form_pos)
    form_pos = :top
  end

  if form_pos == :top
    cols_book = Manifestation::BOOK_COLUMNS.call.map{|c| "book.#{c}"}
    cols_series = Manifestation::SERIES_COLUMNS.map{|c| "series.#{c}"}
    cols_article = Manifestation::ARTICLE_COLUMNS.map{|c| "article.#{c}"}
    cols_all = Manifestation::ALL_COLUMNS
  end

  form_sub_header = nil
  need_to_render_add_mode_tags = false
  case
  when @index_agent[:creator]
    form_type = :creator
    form_opts = {:url => creator_manifestations_path(@index_agent[:creator]), :method => :get}
    form_opts_ex = {:url => output_excelx_creator_manifestations_path(@index_agent[:creator])}
    need_to_render_add_mode_tags = true if can?(:create, Create)
  when @index_agent[:contributor]
    form_type = :contributor
    form_opts = {:url => contributor_manifestations_path(@index_agent[:contributor]), :method => :get}
    form_opts_ex = {:url => output_excelx_contributor_manifestations_path(@index_agent[:contributor])}
    need_to_render_add_mode_tags = true if can?(:create, Realize)
  when @index_agent[:publisher]
    form_type = :publisher
    form_opts = {:url => publisher_manifestations_path(@index_agent[:publisher]), :method => :get}
    form_opts_ex = {:url => output_excelx_publisher_manifestations_path(@index_agent[:publisher])}
    need_to_render_add_mode_tags = true if can?(:create, Produce)
  when @manifestation
    form_type = :manifestation
    form_opts = {:url => manifestation_manifestations_path(@manifestation), :method => :get}
    form_opts_ex = {:url => output_excelx_manifestation_manifestations_path(@manifestation)}
    need_to_render_add_mode_tags = true if can?(:create, ManifestationRelationship)
  when @series_statement
    form_type = :series_statement
    form_opts = {:url => series_statement_manifestations_path(@series_statement), :method => :get}
    form_opts_ex = {:url => output_excelx_series_statement_manifestations_path(@series_statement)}
    form_sub_header = "index_form_#{form_type}_header"
    need_to_render_add_mode_tags = true if can?(:update, Manifestation)
  when @binder
    form_type = :bookbinding
    form_opts = {:url => {:controller => 'manifestations', :action => 'index', :bookbinder_id => @binder.id}, :method => :get}
    form_opts_ex = {:url => {:controller => 'manifestations', :action => 'output_excelx', :bookbinder_id => @binder.id}}
    form_sub_header = "index_form_#{form_type}_header"
    need_to_render_add_mode_tags = true if can?(:update, Manifestation)
  else
    form_type = :basic
    form_opts = {:method => :get}
    form_opts_ex = {:url => {:action => 'output_excelx'}, :method => :post}
  end

  methods = [:get, :post]
-%>

<%- if form_pos == :top && form_sub_header -%>
  <%= render form_sub_header %>
<%- end -%>

<%- methods.each do |method| %>
  <% if method == :post %><% opts = form_opts_ex %><% else %><% opts = form_opts %><% end %>
  <%= form_for :manifestations, opts do -%>
    <p <% if method == :post %>style='display:none;'<% end %>>
      <%= t('page.search_term') -%>:
      <%= search_field_tag 'query', h(@query), {:id => "search_form_#{form_pos}", :class => 'search_form', :placeholder => t('page.search_term')} -%>
      <%- if form_type == :basic %>
        <%= hidden_field_tag 'user_id', params[:user_id] if params[:user_id] -%>
        <%= hidden_field_tag 'removed', true if @removed %>
        <%= hidden_field_tag 'basket_id', params[:basket_id] if params[:basket_id] %>
      <%- end -%>
      <%= hidden_advanced_search_field_tags -%>
      <%- if need_to_render_add_mode_tags -%>
        <%= render 'page/add' %>
      <%- end -%>
      <%= submit_tag t('page.search') -%>
      <% if @query.present? %>
        <input type="button" value="<%= t('page.search_clear') -%>" onclick='<%= "$(" + "'#search_form_#{form_pos}" + "').val('')" %>' >
      <% end %>
      <%- if SystemConfiguration.get('nacsis.can_use') -%>
        <br />
        <%= radio_button_tag 'index', 'local', params[:index] == "local" ? true : false, {:checked => true} -%><%= t('page.search_local') -%>
        <%= radio_button_tag 'index', 'nacsis', params[:index] == "nacsis" ? true : false -%><%= t('page.search_nacsis') -%>
        <br />
      <%- end -%>
      <% unless SystemConfiguration.get("manifestation.show_all") %>
        <% if user_signed_in? and current_user.has_role?('Librarian') %>
          <%- if @all_manifestations %>
            <%= check_box_tag 'all_manifestations', true, true %>
          <%- else -%>
            <%= check_box_tag 'all_manifestations', true %>
          <%- end -%>
          <%= t('advanced_search.all_manifestations') %>
        <% end %>
      <% end %>
      <br />
      <%= link_to_advanced_search -%> <%= link_to_normal_search -%> <%= advanced_search_condition_summary -%>
      <br />
      <%= hidden_field_tag 'reservable', params[:reservable] if params[:reservable] -%>
      <%= hidden_field_tag 'carrier_type', params[:carrier_type] if params[:carrier_type] -%>
      <%= hidden_field_tag 'library', params[:library] if params[:library] -%>
      <%- if params[:language].present? && params[:language].kind_of?(Array) -%>
        <%- params[:language].each do |language| -%>
          <%= hidden_field_tag 'language[]', language -%>
        <%- end -%>
      <%- end -%><commit_msg>refs 7130 シリーズの各号検索時はNACSISを選択しない<commit_after><%-
  unless defined?(form_pos)
    form_pos = :top
  end

  if form_pos == :top
    cols_book = Manifestation::BOOK_COLUMNS.call.map{|c| "book.#{c}"}
    cols_series = Manifestation::SERIES_COLUMNS.map{|c| "series.#{c}"}
    cols_article = Manifestation::ARTICLE_COLUMNS.map{|c| "article.#{c}"}
    cols_all = Manifestation::ALL_COLUMNS
  end

  form_sub_header = nil
  need_to_render_add_mode_tags = false
  case
  when @index_agent[:creator]
    form_type = :creator
    form_opts = {:url => creator_manifestations_path(@index_agent[:creator]), :method => :get}
    form_opts_ex = {:url => output_excelx_creator_manifestations_path(@index_agent[:creator])}
    need_to_render_add_mode_tags = true if can?(:create, Create)
  when @index_agent[:contributor]
    form_type = :contributor
    form_opts = {:url => contributor_manifestations_path(@index_agent[:contributor]), :method => :get}
    form_opts_ex = {:url => output_excelx_contributor_manifestations_path(@index_agent[:contributor])}
    need_to_render_add_mode_tags = true if can?(:create, Realize)
  when @index_agent[:publisher]
    form_type = :publisher
    form_opts = {:url => publisher_manifestations_path(@index_agent[:publisher]), :method => :get}
    form_opts_ex = {:url => output_excelx_publisher_manifestations_path(@index_agent[:publisher])}
    need_to_render_add_mode_tags = true if can?(:create, Produce)
  when @manifestation
    form_type = :manifestation
    form_opts = {:url => manifestation_manifestations_path(@manifestation), :method => :get}
    form_opts_ex = {:url => output_excelx_manifestation_manifestations_path(@manifestation)}
    need_to_render_add_mode_tags = true if can?(:create, ManifestationRelationship)
  when @series_statement
    form_type = :series_statement
    form_opts = {:url => series_statement_manifestations_path(@series_statement), :method => :get}
    form_opts_ex = {:url => output_excelx_series_statement_manifestations_path(@series_statement)}
    form_sub_header = "index_form_#{form_type}_header"
    need_to_render_add_mode_tags = true if can?(:update, Manifestation)
  when @binder
    form_type = :bookbinding
    form_opts = {:url => {:controller => 'manifestations', :action => 'index', :bookbinder_id => @binder.id}, :method => :get}
    form_opts_ex = {:url => {:controller => 'manifestations', :action => 'output_excelx', :bookbinder_id => @binder.id}}
    form_sub_header = "index_form_#{form_type}_header"
    need_to_render_add_mode_tags = true if can?(:update, Manifestation)
  else
    form_type = :basic
    form_opts = {:method => :get}
    form_opts_ex = {:url => {:action => 'output_excelx'}, :method => :post}
  end

  methods = [:get, :post]
-%>

<%- if form_pos == :top && form_sub_header -%>
  <%= render form_sub_header %>
<%- end -%>

<%- methods.each do |method| %>
  <% if method == :post %><% opts = form_opts_ex %><% else %><% opts = form_opts %><% end %>
  <%= form_for :manifestations, opts do -%>
    <p <% if method == :post %>style='display:none;'<% end %>>
      <%= t('page.search_term') -%>:
      <%= search_field_tag 'query', h(@query), {:id => "search_form_#{form_pos}", :class => 'search_form', :placeholder => t('page.search_term')} -%>
      <%- if form_type == :basic %>
        <%= hidden_field_tag 'user_id', params[:user_id] if params[:user_id] -%>
        <%= hidden_field_tag 'removed', true if @removed %>
        <%= hidden_field_tag 'basket_id', params[:basket_id] if params[:basket_id] %>
      <%- end -%>
      <%= hidden_advanced_search_field_tags -%>
      <%- if need_to_render_add_mode_tags -%>
        <%= render 'page/add' %>
      <%- end -%>
      <%= submit_tag t('page.search') -%>
      <% if @query.present? %>
        <input type="button" value="<%= t('page.search_clear') -%>" onclick='<%= "$(" + "'#search_form_#{form_pos}" + "').val('')" %>' >
      <% end %>
      <br />
      <%- if SystemConfiguration.get('nacsis.can_use') && !@series_statement -%>
        <%= radio_button_tag 'index', 'local', params[:index] == "local" ? true : false, {:checked => true} -%><%= t('page.search_local') -%>
        <%= radio_button_tag 'index', 'nacsis', params[:index] == "nacsis" ? true : false -%><%= t('page.search_nacsis') -%>
        <br />
      <%- end -%>
      <% unless SystemConfiguration.get("manifestation.show_all") %>
        <% if user_signed_in? and current_user.has_role?('Librarian') %>
          <%- if @all_manifestations %>
            <%= check_box_tag 'all_manifestations', true, true %>
          <%- else -%>
            <%= check_box_tag 'all_manifestations', true %>
          <%- end -%>
          <%= t('advanced_search.all_manifestations') %>
        <% end %>
      <% end %>
      <br />
      <%= link_to_advanced_search -%> <%= link_to_normal_search -%> <%= advanced_search_condition_summary -%>
      <br />
      <%= hidden_field_tag 'reservable', params[:reservable] if params[:reservable] -%>
      <%= hidden_field_tag 'carrier_type', params[:carrier_type] if params[:carrier_type] -%>
      <%= hidden_field_tag 'library', params[:library] if params[:library] -%>
      <%- if params[:language].present? && params[:language].kind_of?(Array) -%>
        <%- params[:language].each do |language| -%>
          <%= hidden_field_tag 'language[]', language -%>
        <%- end -%>
      <%- end -%>
{'fraction_non_alphanumeric': 0.17506085002808464, 'fraction_numerical': 0.0003744617112900206, 'mean_word_length': 3.9665271966527196, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 191, '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': '2002810', 'n_tokens_mistral': 3916, 'n_tokens_neox': 3669, 'n_words': 619}