aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGuillaume2017-10-18 14:19:47 +0200
committerGuillaume2017-10-18 14:20:19 +0200
commit8f16ba911810f93c5a651e6fb9c355953e41d53c (patch)
tree638b9e0d807c5c7ede70f504610f64b7bd5bf9a3 /app
parent5559c8639f977b2ee946d3f982da1bbf0643a5a4 (diff)
downloadchouette-core-8f16ba911810f93c5a651e6fb9c355953e41d53c.tar.bz2
add clone method in compliance_control_sets_controller, add duplicate button to IHM and flash message Refs #4741
Diffstat (limited to 'app')
-rw-r--r--app/controllers/compliance_control_sets_controller.rb11
-rw-r--r--app/decorators/compliance_control_set_decorator.rb7
2 files changed, 16 insertions, 2 deletions
diff --git a/app/controllers/compliance_control_sets_controller.rb b/app/controllers/compliance_control_sets_controller.rb
index 9de90c21c..1f578f781 100644
--- a/app/controllers/compliance_control_sets_controller.rb
+++ b/app/controllers/compliance_control_sets_controller.rb
@@ -23,12 +23,19 @@ class ComplianceControlSetsController < BreadcrumbController
end
end
- protected
-
def begin_of_association_chain
current_organisation
end
+ def clone
+ ComplianceControlSetCloner.new.copy(params[:id], current_organisation)
+ flash[:notice] = I18n.t("compliance_control_sets.errors.operation_in_progress")
+ redirect_to(compliance_control_sets_path)
+ end
+
+ protected
+
+
private
def decorate_compliance_control_sets(compliance_control_sets)
diff --git a/app/decorators/compliance_control_set_decorator.rb b/app/decorators/compliance_control_set_decorator.rb
index f4aa607e1..7515316ce 100644
--- a/app/decorators/compliance_control_set_decorator.rb
+++ b/app/decorators/compliance_control_set_decorator.rb
@@ -4,6 +4,13 @@ class ComplianceControlSetDecorator < Draper::Decorator
def action_links
links = []
+ # if policy.clone?
+ links << Link.new(
+ content: h.t('actions.clone'),
+ href: h.clone_compliance_control_set_path(object.id)
+ )
+ # end
+
# if h.policy(object).destroy?
links << Link.new(
content: h.destroy_link_content,