aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2016-07-27 18:19:29 +0200
committerjpl2016-07-27 18:19:29 +0200
commit2bdb59ac8e1161e30caa038e057ec49212ae8d04 (patch)
treef606601e422486ea886d9be99139f3ee11ddfe4f
parentbb307e52c60780517a21de31ba07b4c4720c9a4f (diff)
downloadchouette-core-2bdb59ac8e1161e30caa038e057ec49212ae8d04.tar.bz2
Refs #1295: convert erb to slim (compliance_check_tasks)
-rw-r--r--app/views/compliance_check_tasks/new.html.erb20
-rw-r--r--app/views/compliance_check_tasks/new.html.slim17
-rw-r--r--app/views/compliance_check_tasks/new.js.coffee9
3 files changed, 23 insertions, 23 deletions
diff --git a/app/views/compliance_check_tasks/new.html.erb b/app/views/compliance_check_tasks/new.html.erb
deleted file mode 100644
index 49e4fae19..000000000
--- a/app/views/compliance_check_tasks/new.html.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-<%= 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 %>
diff --git a/app/views/compliance_check_tasks/new.html.slim b/app/views/compliance_check_tasks/new.html.slim
new file mode 100644
index 000000000..212e7f618
--- /dev/null
+++ b/app/views/compliance_check_tasks/new.html.slim
@@ -0,0 +1,17 @@
+= 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}" }
+
+ = form.actions do
+ = form.action :submit, as: :button, label: t('formtastic.validate')
+ = form.action :cancel, as: :link \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/new.js.coffee b/app/views/compliance_check_tasks/new.js.coffee
index 32cfa851a..d7066b6f7 100644
--- a/app/views/compliance_check_tasks/new.js.coffee
+++ b/app/views/compliance_check_tasks/new.js.coffee
@@ -1,4 +1,7 @@
jQuery ->
- <% ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| %>
- $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'});
- <% end %>
+ # <% ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| %>
+ # $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'});
+ # <% end %>
+
+ - ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt|
+ $("textarea.#{rt.input_class}").tokenInput("#{references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, format: :json)}", { prePopulate: $('#').data('pre'), minChars: 1, hintText: "#{t('search_hint')}", noResultsText: "#{t('no_result_text')}", searchingText: "#{t('searching_term')}"});