aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/compliance_check_sets_controller.rb5
-rw-r--r--app/decorators/compliance_check_set_decorator.rb12
-rw-r--r--app/views/compliance_check_sets/index.html.slim1
-rw-r--r--app/views/compliance_check_sets/show.html.slim11
4 files changed, 7 insertions, 22 deletions
diff --git a/app/controllers/compliance_check_sets_controller.rb b/app/controllers/compliance_check_sets_controller.rb
index 600c69126..d05a81d61 100644
--- a/app/controllers/compliance_check_sets_controller.rb
+++ b/app/controllers/compliance_check_sets_controller.rb
@@ -11,9 +11,8 @@ class ComplianceCheckSetsController < ChouetteController
scope = self.ransack_period_range(scope: @compliance_check_sets, error_message: t('compliance_check_sets.filters.error_period_filter'), query: :where_created_at_between)
@q_for_form = scope.ransack(params[:q])
format.html {
- @compliance_check_sets = ModelDecorator.decorate(
- @q_for_form.result.order(created_at: :desc),
- with: ComplianceCheckSetDecorator
+ @compliance_check_sets = ComplianceCheckSetDecorator.decorate(
+ @q_for_form.result.order(created_at: :desc)
)
}
end
diff --git a/app/decorators/compliance_check_set_decorator.rb b/app/decorators/compliance_check_set_decorator.rb
index c58e14d88..1a9c19546 100644
--- a/app/decorators/compliance_check_set_decorator.rb
+++ b/app/decorators/compliance_check_set_decorator.rb
@@ -1,15 +1,13 @@
-class ComplianceCheckSetDecorator < Draper::Decorator
- delegate_all
-
- def action_links
- links = []
+class ComplianceCheckSetDecorator < AF83::Decorator
+ with_instance_decorator do |instance_decorator|
+ instance_decorator.show_action_link
end
- def lines_status
+ define_instance_method :lines_status do
object.compliance_check_resources.where(status: :OK, resource_type: :line).count
end
- def lines_in_compliance_check_set
+ define_instance_method :lines_in_compliance_check_set do
object.compliance_check_resources.where(resource_type: :line).count
end
diff --git a/app/views/compliance_check_sets/index.html.slim b/app/views/compliance_check_sets/index.html.slim
index f109845b4..da68663b2 100644
--- a/app/views/compliance_check_sets/index.html.slim
+++ b/app/views/compliance_check_sets/index.html.slim
@@ -35,7 +35,6 @@
), \
],
sortable: true,
- links: [:show],
cls: 'table has-filter has-search'
- unless @compliance_check_sets.any?
.row.mt-xs
diff --git a/app/views/compliance_check_sets/show.html.slim b/app/views/compliance_check_sets/show.html.slim
index 35a60eb52..e0ee0af55 100644
--- a/app/views/compliance_check_sets/show.html.slim
+++ b/app/views/compliance_check_sets/show.html.slim
@@ -1,15 +1,4 @@
- breadcrumb :compliance_check_sets, @workbench, @compliance_check_set
-/ PageHeader
-- content_for :page_header_content do
- .row
- .col-lg-12.text-right.mb-sm
- - @compliance_check_set.action_links.each do |link|
- = link_to link.href,
- method: link.method,
- data: link.data,
- class: 'btn btn-primary' do
- = link.content
-
- page_header_content_for @compliance_check_set
/ = pageheader 'jeux-de-donnees',
/ @compliance_check_set.name,