aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2016-12-09 11:26:47 +0100
committerjpl2016-12-09 11:26:47 +0100
commit6f023547de72014b20ad24e2cd856d5e312ee2ff (patch)
tree0d796b567b4ae7e36be62f44c356889a99ffaa9c
parente3d09f6e7b2814dd78492b6f1d018136143df058 (diff)
downloadchouette-core-6f023547de72014b20ad24e2cd856d5e312ee2ff.tar.bz2
fix some compliance_checks errors on views
-rw-r--r--app/views/compliance_check_tasks/new.html.erb39
-rw-r--r--app/views/compliance_check_tasks/new.html.slim17
-rw-r--r--app/views/compliance_check_tasks/new.js.coffee10
-rw-r--r--app/views/compliance_checks/_compliance_check.html.slim4
-rw-r--r--app/views/compliance_checks/_compliance_check_results.html.slim4
-rw-r--r--app/views/shared/_ie_report_file.html.slim6
-rw-r--r--app/views/shared/_ie_report_line.html.slim4
7 files changed, 53 insertions, 31 deletions
diff --git a/app/views/compliance_check_tasks/new.html.erb b/app/views/compliance_check_tasks/new.html.erb
new file mode 100644
index 000000000..3f43a7dd7
--- /dev/null
+++ b/app/views/compliance_check_tasks/new.html.erb
@@ -0,0 +1,39 @@
+<%= 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 %>
+
+<!-- = 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 -->
diff --git a/app/views/compliance_check_tasks/new.html.slim b/app/views/compliance_check_tasks/new.html.slim
deleted file mode 100644
index 212e7f618..000000000
--- a/app/views/compliance_check_tasks/new.html.slim
+++ /dev/null
@@ -1,17 +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}" }
-
- = 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 d7066b6f7..ba62f53b2 100644
--- a/app/views/compliance_check_tasks/new.js.coffee
+++ b/app/views/compliance_check_tasks/new.js.coffee
@@ -1,7 +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')}"});
+ # - 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')}"});
diff --git a/app/views/compliance_checks/_compliance_check.html.slim b/app/views/compliance_checks/_compliance_check.html.slim
index db4753563..383a7ea82 100644
--- a/app/views/compliance_checks/_compliance_check.html.slim
+++ b/app/views/compliance_checks/_compliance_check.html.slim
@@ -10,8 +10,8 @@
.panel-body
p
- = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, compliance_check.id)) if compliance_check.report?
+ = link_to( font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, compliance_check.id)) if compliance_check.report?
.panel-footer
.history
= l compliance_check.created_at, :format => "%d/%m/%Y %H:%M"
- = " | #{compliance_check.user_name}" \ No newline at end of file
+ = " | #{compliance_check.user_name}"
diff --git a/app/views/compliance_checks/_compliance_check_results.html.slim b/app/views/compliance_checks/_compliance_check_results.html.slim
index e2b8cb6f4..8e86c174e 100644
--- a/app/views/compliance_checks/_compliance_check_results.html.slim
+++ b/app/views/compliance_checks/_compliance_check_results.html.slim
@@ -25,7 +25,7 @@ p
= t('compliance_check_result.statuses.uncheck')
-table.table.table-hover.toggle-circle.toggle-medium data-filter="#filter" data-page-size="20" data-title-nok="#{t('compliance_check_result.statuses.nok')}" data-title-uncheck="#{t('compliance_check_result.statuses.uncheck')}" data-title-ok="#{t('compliance_check_result.statuses.ok')}
+table.table.table-hover.toggle-circle.toggle-medium data-filter="#filter" data-page-size="20" data-title-nok="#{t('compliance_check_result.statuses.nok')}" data-title-uncheck="#{t('compliance_check_result.statuses.uncheck')}" data-title-ok="#{t('compliance_check_result.statuses.ok')}"
thead
tr
th data-sort-ignore="true"
@@ -89,4 +89,4 @@ table.table.table-hover.toggle-circle.toggle-medium data-filter="#filter" data-p
tfoot.hide-if-no-paging
tr
td colspan="5"
- ul.pagination.pagination-centered \ No newline at end of file
+ ul.pagination.pagination-centered
diff --git a/app/views/shared/_ie_report_file.html.slim b/app/views/shared/_ie_report_file.html.slim
index b0cd0b427..edf1e74fa 100644
--- a/app/views/shared/_ie_report_file.html.slim
+++ b/app/views/shared/_ie_report_file.html.slim
@@ -1,5 +1,5 @@
p.lead
- p.caption = t('.title_default', job=job.class.model_name.human extension=job.filename_extension )
+ p.caption = t('.title_default', job: job.class.model_name.human, extension: job.filename_extension)
.report.results data-refresh-interval="#{job_refresh_interval(job)}"
p
@@ -27,8 +27,8 @@ p.lead
td data-value="#{file.status.downcase}"
= t(".table.#{file.status.downcase}")
td = file.name
- td = file.errors.map |e| "#{e.code} : #{e.description}" .join(' | ') if file.errors.present?
+ td = file.errors.map{ |e| "#{e.code} : #{e.description}" }.join(' | ') if file.errors.present?
tfoot
tr
td colspan="5"
- ul.pagination.pagination-centered \ No newline at end of file
+ ul.pagination.pagination-centered
diff --git a/app/views/shared/_ie_report_line.html.slim b/app/views/shared/_ie_report_line.html.slim
index c2a24f1e4..32816f63b 100644
--- a/app/views/shared/_ie_report_line.html.slim
+++ b/app/views/shared/_ie_report_line.html.slim
@@ -40,7 +40,7 @@ p.lead
- line_items.each_with_index do |line_item, index|
tr
td data-value="#{line_item.status}"
- = line_item.status ? font_awesome_classic_tag(fa-check) : font_awesome_classic_tag(fa-times)
+ = line_item.status ? font_awesome_classic_tag('fa-check') : font_awesome_classic_tag('fa-times')
td = line_item.name
td
@@ -58,4 +58,4 @@ p.lead
- if line_items.respond_to?(:total_pages)
= will_paginate line_items, renderer: BootstrapPagination::Rails
- else
- ul.pagination.pagination-centered.hide-if-no-paging \ No newline at end of file
+ ul.pagination.pagination-centered.hide-if-no-paging