aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/workbenches_controller.rb15
-rw-r--r--app/views/workbenches/_form.html.slim9
-rw-r--r--app/views/workbenches/edit.html.slim8
3 files changed, 30 insertions, 2 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index 2a71fe811..a7786bc8b 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -3,7 +3,10 @@ class WorkbenchesController < ChouetteController
include RansackDateFilter
before_action only: [:show] { set_date_time_params("validity_period", Date) }
defaults resource_class: Workbench
- respond_to :html, only: [:show, :index]
+
+ include PolicyChecker
+
+ respond_to :html
def index
redirect_to dashboard_path
@@ -24,7 +27,10 @@ class WorkbenchesController < ChouetteController
current_workbench_id: params[:id]
}
)
- show!
+ end
+
+ def edit
+ edit!
end
def delete_referentials
@@ -38,6 +44,11 @@ class WorkbenchesController < ChouetteController
end
private
+
+ def workbench_params
+ params.require(:workbench).permit(:import_compliance_control_set_id, :merge_compliance_control_set_id)
+ end
+
def resource
@workbench = current_organisation.workbenches.find params[:id]
end
diff --git a/app/views/workbenches/_form.html.slim b/app/views/workbenches/_form.html.slim
new file mode 100644
index 000000000..5ee17dc17
--- /dev/null
+++ b/app/views/workbenches/_form.html.slim
@@ -0,0 +1,9 @@
+= simple_form_for @workbench, html: { class: 'form-horizontal', id: 'workbench_form' }, wrapper: :horizontal_form do |f|
+ .row
+ .col-lg-12
+ = f.input :import_compliance_control_set_id, as: :select, collection: ComplianceControlSet.where(organisation: current_organisation), value_method: lambda {|t| t.id}
+ = f.input :merge_compliance_control_set_id, as: :select, collection: ComplianceControlSet.where(organisation: current_organisation), value_method: lambda {|t| t.id}
+
+ .separator
+
+ = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'workbench_form'
diff --git a/app/views/workbenches/edit.html.slim b/app/views/workbenches/edit.html.slim
new file mode 100644
index 000000000..893024490
--- /dev/null
+++ b/app/views/workbenches/edit.html.slim
@@ -0,0 +1,8 @@
+- breadcrumb @workbench
+- page_header_content_for @workbench
+
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ == render 'form'