aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Perles2015-12-22 15:53:51 +0100
committerBruno Perles2015-12-22 15:53:51 +0100
commitfece6201e4141048c2b4f639b3d9e7b5c1a137ac (patch)
treee9c595363528e81599e6dc4fe2ebfef7e81ccd58
parent59cf9d58b61887ab275089fae096ceaea134214d (diff)
downloadchouette-core-fece6201e4141048c2b4f639b3d9e7b5c1a137ac.tar.bz2
Update locales, line_items and pagination for validation with huge lines
-rw-r--r--app/assets/javascripts/partials/ie_report.js.coffee.erb3
-rw-r--r--app/assets/stylesheets/modules/job_status_colors.scss2
-rw-r--r--app/controllers/compliance_checks_controller.rb5
-rw-r--r--app/controllers/imports_controller.rb1
-rw-r--r--app/views/compliance_checks/_compliance_check_results.erb2
-rw-r--r--app/views/compliance_checks/show.html.erb2
-rw-r--r--app/views/shared/_ie_report_file.html.erb2
-rw-r--r--app/views/shared/_ie_report_line.html.erb13
8 files changed, 18 insertions, 12 deletions
diff --git a/app/assets/javascripts/partials/ie_report.js.coffee.erb b/app/assets/javascripts/partials/ie_report.js.coffee.erb
index 20c6dbb16..5d42566ea 100644
--- a/app/assets/javascripts/partials/ie_report.js.coffee.erb
+++ b/app/assets/javascripts/partials/ie_report.js.coffee.erb
@@ -6,7 +6,8 @@ $(".imports.show, .exports.show, .compliance_checks.show").ready ->
setInterval(reloadPage,refreshInterval * 1000)
footableFilter = (parent, el) ->
- $(parent).footable().bind 'footable_filtering', (e) ->
+ no_pagination = $(parent).data('no-pagination') != true
+ $(parent).footable( { paginate: no_pagination } ).bind 'footable_filtering', (e) ->
selected = $("select#{el} option:selected").val()
if selected and selected.length > 0
e.filter += if e.filter and e.filter.length > 0 then ' ' + selected else selected
diff --git a/app/assets/stylesheets/modules/job_status_colors.scss b/app/assets/stylesheets/modules/job_status_colors.scss
index 3c9086471..b3ae3d72c 100644
--- a/app/assets/stylesheets/modules/job_status_colors.scss
+++ b/app/assets/stylesheets/modules/job_status_colors.scss
@@ -1,4 +1,4 @@
.terminated{ color: $brand-success; }
-.processed{ color: $brand-info; }
+.processed{ color: $brand-info; box-shadow: none; }
.aborted{ color: $brand-danger; }
diff --git a/app/controllers/compliance_checks_controller.rb b/app/controllers/compliance_checks_controller.rb
index 39ae397e6..d8f8d17b2 100644
--- a/app/controllers/compliance_checks_controller.rb
+++ b/app/controllers/compliance_checks_controller.rb
@@ -73,6 +73,11 @@ class ComplianceChecksController < ChouetteController
def resource
@compliance_check ||= compliance_check_service.find(params[:id])
+ @line_items = @compliance_check.report.line_items
+ if @line_items.size > 500
+ @line_items = @line_items.paginate(page: params[:page], per_page: 20)
+ end
+ @compliance_check
end
def collection
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 44f0307a0..ea91d8d8b 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -100,6 +100,7 @@ class ImportsController < ChouetteController
if @line_items.size > 500
@line_items = @line_items.paginate(page: params[:page], per_page: 20)
end
+ @import
end
def collection
diff --git a/app/views/compliance_checks/_compliance_check_results.erb b/app/views/compliance_checks/_compliance_check_results.erb
index ab8d283eb..acc60e1fa 100644
--- a/app/views/compliance_checks/_compliance_check_results.erb
+++ b/app/views/compliance_checks/_compliance_check_results.erb
@@ -1,7 +1,7 @@
<p>
<form class="form-inline">
<div class="form-group">
- <label><%= t("shared.ie_report.html.search") %></label>
+ <label><%= t("shared.ie_report.search") %></label>
<input id="filter" type="text" class="form-control">
</div>
<div class="form-group">
diff --git a/app/views/compliance_checks/show.html.erb b/app/views/compliance_checks/show.html.erb
index 1a1f842f5..1b656692e 100644
--- a/app/views/compliance_checks/show.html.erb
+++ b/app/views/compliance_checks/show.html.erb
@@ -13,7 +13,7 @@
<div class="links">
<%= 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.compliance_check_validation_report? %>
</div>
- <%= render(partial: "shared/ie_report.html", locals: { job: @compliance_check, type: :validation } ) %>
+ <%= render(partial: "shared/ie_report", locals: { job: @compliance_check, type: :validation, line_items: @line_items } ) %>
</div>
<% content_for :sidebar do %>
diff --git a/app/views/shared/_ie_report_file.html.erb b/app/views/shared/_ie_report_file.html.erb
index 20e4bb659..fdd97f128 100644
--- a/app/views/shared/_ie_report_file.html.erb
+++ b/app/views/shared/_ie_report_file.html.erb
@@ -5,7 +5,7 @@
<p>
<form class="form-inline">
<div class="form-group">
- <label><%= t("shared.ie_report.html.search") %></label>
+ <label><%= t("shared.ie_report.search") %></label>
<input id="filter-file" type="text" class="form-control">
</div>
<div class="form-group">
diff --git a/app/views/shared/_ie_report_line.html.erb b/app/views/shared/_ie_report_line.html.erb
index 69a12779c..2f5332e5b 100644
--- a/app/views/shared/_ie_report_line.html.erb
+++ b/app/views/shared/_ie_report_line.html.erb
@@ -12,7 +12,7 @@
<p>
<form class="form-inline">
<div class="form-group">
- <label><%= t("shared.ie_report.html.search") %></label>
+ <label><%= t("shared.ie_report.search") %></label>
<input id="filter-line" type="text" class="form-control">
</div>
<div class="form-group">
@@ -25,7 +25,7 @@
</div>
</form>
</p>
- <table class="table table-hover table-striped data-table toggle-circle toggle-medium" data-filter="#filter-line" id="table-line"<% unless line_items.respond_to?(:total_pages) %> data-page-size="20"<% end %>>
+ <table class="table table-hover table-striped data-table toggle-circle toggle-medium" data-filter="#filter-line" id="table-line" data-page-size="20"<% if line_items.respond_to?(:total_pages) %> data-no-pagination="true"<% end %>>
<thead>
<tr>
<th><%= t(".table.line.state") %></th>
@@ -59,14 +59,13 @@
<tfoot>
<tr>
<td colspan="10">
- <% unless line_items.respond_to?(:total_pages) %>
- <ul class="pagination pagination-centered"></ul>
+ <% if line_items.respond_to?(:total_pages) %>
+ <%= will_paginate line_items, renderer: BootstrapPagination::Rails %>
+ <% else %>
+ <ul class="pagination pagination-centered hide-if-no-paging"></ul>
<% end %>
</td>
</tr>
</tfoot>
</table>
- <% if line_items.respond_to?(:total_pages) %>
- <%= will_paginate line_items, renderer: BootstrapPagination::Rails %>
- <% end %>
</div>