diff options
| author | teddywing | 2017-10-19 17:05:12 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-19 17:05:12 +0200 |
| commit | 3ee97da2ff5c782debcce2ab7365110c95471942 (patch) | |
| tree | 0fae2845185c36936f54ec3603c051563bd3364f /app | |
| parent | 86122f091fc58cccaa882e1d76368730f16d30da (diff) | |
| parent | aba7a66a6baf07b38e346caf05ae5606804d2976 (diff) | |
| download | chouette-core-3ee97da2ff5c782debcce2ab7365110c95471942.tar.bz2 | |
Merge pull request #97 from af83/4741-clone_compliance_control_set
add clone method in compliance_control_sets_controller, add duplicate…
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/compliance_control_sets_controller.rb | 8 | ||||
| -rw-r--r-- | app/decorators/compliance_control_set_decorator.rb | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/compliance_control_sets_controller.rb b/app/controllers/compliance_control_sets_controller.rb index 9de90c21c..e5c2e19dd 100644 --- a/app/controllers/compliance_control_sets_controller.rb +++ b/app/controllers/compliance_control_sets_controller.rb @@ -23,6 +23,12 @@ class ComplianceControlSetsController < BreadcrumbController end end + def clone + ComplianceControlSetCloner.new.copy(params[:id], current_organisation.id) + flash[:notice] = I18n.t("compliance_control_sets.errors.operation_in_progress") + redirect_to(compliance_control_sets_path) + end + protected def begin_of_association_chain @@ -48,4 +54,4 @@ class ComplianceControlSetsController < BreadcrumbController def compliance_control_set_params params.require(:compliance_control_set).permit(:name, :id) end -end +end
\ No newline at end of file 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, |
