afimb/chouette2

View on GitHub
app/views/compliance_check_tasks/new.html.erb

Summary

Maintainability
Test Coverage
<%= title_tag t(".title") %>

<%= semantic_form_for [@referential, @compliance_check_task], :url => referential_compliance_check_tasks_path(@referential) do |form| %>
  <%= form.inputs do %>
    <%= form.input :user_name, :as => :hidden, :input_html => { :value => current_user.name } %>      <%= form.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %>
    <%= form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } %>      
    <%= form.input :name %>  
    <%= form.input :rule_parameter_set_id, :as => :select,
          :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => false %>
      <%= form.input :references_type, :as => :select, :include_blank => t(".all") %>
      <% @compliance_check_task.class.references_types.each do |type| %>
    <%= form.input :reference_ids, :as => :reference_ids, :json => references_referential_compliance_check_tasks_path(@referential, :format => :json) + "?filter=#{type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :id => "#{type}_reference_ids", :input_html => { :id => "#{type}_reference_ids" }, :wrapper_html => { :style => "display:none;", :id => "#{type}", :"data-type" => "#{type}" } %>
      <% end %>
  <% end %>

   <%= form.actions do %>
     <%= form.action :submit, :as => :button , :label => t( 'formtastic.validate' ) %>
     <%= form.action :cancel, :as => :link %>
   <% end %>
<% end %>