diff options
| author | Robert | 2017-10-25 17:25:25 +0200 |
|---|---|---|
| committer | Robert | 2017-10-31 19:08:52 +0100 |
| commit | e28f3a8c95749841fac99ff031745174f3e6b0e4 (patch) | |
| tree | ac7d07487889257be2dc3367c2332450715c90ec /app/views/compliance_control_sets | |
| parent | 65102f16cb86e09e65557e82dda2c920ea7a4976 (diff) | |
| download | chouette-core-e28f3a8c95749841fac99ff031745174f3e6b0e4.tar.bz2 | |
Refs: #4774@1.5h;
Table Builder Helper table_builder2 with explicit model: parameter integrated into the view
TODO:
- Feature specs
- Add Ransack Filters
Diffstat (limited to 'app/views/compliance_control_sets')
| -rw-r--r-- | app/views/compliance_control_sets/grouping.html.slim | 39 | ||||
| -rw-r--r-- | app/views/compliance_control_sets/show.html.slim | 12 |
2 files changed, 7 insertions, 44 deletions
diff --git a/app/views/compliance_control_sets/grouping.html.slim b/app/views/compliance_control_sets/grouping.html.slim deleted file mode 100644 index d527601b2..000000000 --- a/app/views/compliance_control_sets/grouping.html.slim +++ /dev/null @@ -1,39 +0,0 @@ -/ PageContent -.page_content - .container-fluid - .row - .col-lg-6.col-md-6.col-sm-12.col-xs-12 - = definition_list t('metadatas'), - ComplianceControlSet.human_attribute_name(:name) => @compliance_control_set.name - .row - .col-lg-12 - h2 - = transport_mode("", "") - .row - .col-lg-12 - .select_table - = table_builder_2 @coontrols, \ - [ \ - TableBuilderHelper::Column.new( \ - key: :code, \ - attribute: 'code' \ - ), \ - TableBuilderHelper::Column.new( \ - key: :name, \ - attribute: 'name', \ - link_to: lambda do |compliance_control| \ - compliance_control_set_compliance_control_path(@compliance_control_set, compliance_control) \ - end \ - ), \ - TableBuilderHelper::Column.new( \ - key: :criticity, \ - attribute: 'criticity' \ - ), \ - TableBuilderHelper::Column.new( \ - key: :comment, \ - attribute: 'comment' \ - ), \ - ], - sortable: true, - cls: 'table has-filter has-search' - diff --git a/app/views/compliance_control_sets/show.html.slim b/app/views/compliance_control_sets/show.html.slim index cf236feb8..28d602eb5 100644 --- a/app/views/compliance_control_sets/show.html.slim +++ b/app/views/compliance_control_sets/show.html.slim @@ -31,7 +31,7 @@ .row .col-lg-12 .select_table - = table_builder_2 @compliance_controls_without_block, + = table_builder_2 @compliance_controls.delete(nil), [ \ TableBuilderHelper::Column.new( \ key: :code, \ @@ -54,9 +54,10 @@ ), \ ], sortable: true, - cls: 'table has-filter has-search' + cls: 'table has-filter has-search', + model: ComplianceControl - - @compliance_control_set.compliance_control_blocks.each do |block| + - @compliance_controls.each do |block, compliance_controls| .row .col-lg-12 h2 @@ -71,7 +72,7 @@ .row .col-lg-12 .select_table - = table_builder_2 ModelDecorator.decorate(block.compliance_controls, with: ComplianceControlDecorator), + = table_builder_2 compliance_controls, [ \ TableBuilderHelper::Column.new( \ key: :code, \ @@ -94,7 +95,8 @@ ), \ ], sortable: true, - cls: 'table has-filter has-search' + cls: 'table has-filter has-search', + model: ComplianceControl .select_toolbox ul li.st_action.with_text |
