aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authoranicet2015-06-22 22:37:40 +0200
committeranicet2015-06-22 22:37:40 +0200
commiteafbf6ea15c5fb027f4e909cc95cd5a3a39070e2 (patch)
tree976126eff1230b51dd04b26a0367407c9c64c824 /app
parent0014ee7862acdbc4d461f008b57af7f80864aa3f (diff)
downloadchouette-core-eafbf6ea15c5fb027f4e909cc95cd5a3a39070e2.tar.bz2
ComplianceCheck Report : display success validation
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/main/compliance_checks.css.scss4
-rw-r--r--app/helpers/application_helper.rb25
-rw-r--r--app/views/compliance_checks/report.html.erb44
3 files changed, 39 insertions, 34 deletions
diff --git a/app/assets/stylesheets/main/compliance_checks.css.scss b/app/assets/stylesheets/main/compliance_checks.css.scss
index 496ebeeae..d31dfab62 100644
--- a/app/assets/stylesheets/main/compliance_checks.css.scss
+++ b/app/assets/stylesheets/main/compliance_checks.css.scss
@@ -9,6 +9,10 @@
@import "../modules/links";
}
+#validation_success{
+ margin-top: 15px;
+}
+
#workspace.compliance_checks.report, #workspace.imports.compliance_check{
@import "../modules/job_status_colors";
@import "../modules/job_status_title";
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index df2cb696b..811ea6f4c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,18 +1,15 @@
module ApplicationHelper
- def font_awesome_classic_tag(name, size = "")
- if name == "fa-file-csv-o"
- name = "fa-file-text-o"
- elsif name == "fa-file-xml-o"
- name = "fa-file-code-o"
- end
- "<i class='fa #{name} #{size}'></i>".html_safe
+ def font_awesome_classic_tag(name)
+ name = "fa-file-text-o" if name == "fa-file-csv-o"
+ name = "fa-file-code-o" if name == "fa-file-xml-o"
+ content_tag(:id, nil, {class: "fa #{name}"})
end
-
+
def stop_area_picture_url(stop_area)
image_path("map/#{stop_area.area_type.underscore}.png")
end
-
+
def selected_referential?
@referential.present? and not @referential.new_record?
end
@@ -29,13 +26,13 @@ module ApplicationHelper
relative_url_root = Rails.application.config.relative_url_root
relative_url_root && !source.starts_with?("#{relative_url_root}/") ? "#{relative_url_root}#{source}" : source
end
-
+
def assets_path_patch( source)
relative_url_root = Rails.application.config.relative_url_root
return "/assets/#{source}" unless relative_url_root
"#{relative_url_root}/assets/#{source}"
end
-
+
def help_page?
controller_name == "help"
@@ -83,9 +80,9 @@ module ApplicationHelper
else
""
end
-
+
url_for(:controller => "/help", :action => "show") + '/' + target
end
-
-
+
+
end
diff --git a/app/views/compliance_checks/report.html.erb b/app/views/compliance_checks/report.html.erb
index e4d91e57c..24cffab38 100644
--- a/app/views/compliance_checks/report.html.erb
+++ b/app/views/compliance_checks/report.html.erb
@@ -8,27 +8,33 @@
<% else %>
<%= link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_compliance_check_path(@referential, @compliance_check.id) if @compliance_check.rule_parameter_set? %>
<% end %>
- <div class="btn-group pull-right">
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
- <%= t("compliance_checks.show.export") %> <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu">
- <li>
- <% if @compliance_check.class == Import %>
- <%= link_to t("compliance_checks.show.export_csv"), export_referential_import_path(@referential, @compliance_check.id) %>
- <% else %>
- <%= link_to t("compliance_checks.show.export_csv"), export_referential_compliance_check_path(@referential, @compliance_check.id) %>
- <% end %>
- </li>
- </ul>
- </div>
- </div>
- <div class="report" data-refresh-interval="<%= job_refresh_interval(@compliance_check) %>">
- <%= render :partial => "compliance_checks/compliance_check_results", :locals => { :compliance_check_validation_report => @compliance_check.compliance_check_validation_report } %>
- </div>
+ <div class="btn-group pull-right">
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
+ <%= t("compliance_checks.show.export") %> <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" role="menu">
+ <li>
+ <% if @compliance_check.class == Import %>
+ <%= link_to t("compliance_checks.show.export_csv"), export_referential_import_path(@referential, @compliance_check.id) %>
+ <% else %>
+ <%= link_to t("compliance_checks.show.export_csv"), export_referential_compliance_check_path(@referential, @compliance_check.id) %>
+ <% end %>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="report" data-refresh-interval="<%= job_refresh_interval(@compliance_check) %>">
+ <%= render :partial => "compliance_checks/compliance_check_results", locals: { compliance_check_validation_report: @compliance_check.compliance_check_validation_report } %>
+ </div>
</div>
<% content_for :sidebar do %>
+ <% if @compliance_check.compliance_check_validation_report.nok_error.blank? %>
+ <div class="row">
+ <%=font_awesome_classic_tag('fa-thumbs-up fa-5x col-md-3')%>
+ <p class='col-md-7' id='validation_success'><%=t('.validation_success')%></p>
+ </div>
+ <% end %>
<ul class="actions">
<li>
<% if @compliance_check.class != Import %>
@@ -39,6 +45,4 @@
<%= history_tag(@compliance_check) %>
<div id="error" class="graph"></div>
<div id="warning" class="graph"></div>
- </div>
-
<% end %>