aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/compliance_check_sets/show.html.slim54
-rw-r--r--app/views/compliance_checks/_filters.html.slim47
-rw-r--r--app/views/compliance_control_sets/show.html.slim17
-rw-r--r--app/views/compliance_controls/_filters.html.slim3
4 files changed, 109 insertions, 12 deletions
diff --git a/app/views/compliance_check_sets/show.html.slim b/app/views/compliance_check_sets/show.html.slim
index eefa5363f..4052707da 100644
--- a/app/views/compliance_check_sets/show.html.slim
+++ b/app/views/compliance_check_sets/show.html.slim
@@ -1,12 +1,60 @@
- breadcrumb :compliance_check_set, @workbench, @compliance_check_set
/ PageHeader
= pageheader 'jeux-de-donnees',
- @compliance_check_set.referential.name
+ t('compliance_check_sets.show.title', name: @compliance_check_set.name),
+ 'Lorem ipsum dolor sit amet'
/ PageContent
.page_content
.container-fluid
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
= definition_list t('metadatas'),
- ComplianceCheckSet.human_attribute_name(:id) => @compliance_check_set.referential.id,
- ComplianceCheckSet.human_attribute_name(:name) => @compliance_check_set.referential.name
+ ComplianceCheckSet.human_attribute_name(:name) => @compliance_check_set.name
+
+ - if params[:q].present? || @compliance_checks.any? || @direct_compliance_checks
+ .row
+ .col-lg-12
+ h2
+ = render '/compliance_checks/filters'
+
+ - if @direct_compliance_checks.try(:any?)
+ .row
+ .col-lg-12
+ h2
+ = transport_mode_text()
+ .row
+ .col-lg-12
+ .select_table
+ = table_builder_2 @direct_compliance_checks,
+ [ \
+ TableBuilderHelper::Column.new( \
+ key: :code, \
+ attribute: 'code' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :name, \
+ attribute: 'name', \
+ link_to: lambda do |compliance_check| \
+ compliance_check_path(compliance_check) \
+ end \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :criticity, \
+ attribute: 'criticity' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :comment, \
+ attribute: 'comment' \
+ ), \
+ ],
+ sortable: true,
+ cls: 'table has-filter has-search',
+ model: ComplianceCheck
+
+ - @compliance_checks.each do |block, compliance_checks|
+
+ - if compliance_checks.try(:any?)
+ .row
+ .col-lg-12
+ h2
+ = transport_mode_text(block)
diff --git a/app/views/compliance_checks/_filters.html.slim b/app/views/compliance_checks/_filters.html.slim
new file mode 100644
index 000000000..189e3d787
--- /dev/null
+++ b/app/views/compliance_checks/_filters.html.slim
@@ -0,0 +1,47 @@
+/ Compliance Check Filter
+= search_form_for @q_checks_form,
+ url: compliance_check_set_path(@compliance_check_set),
+ builder: SimpleForm::FormBuilder,
+ class: 'form form-filter' do |f|
+
+ .ffg-row
+ .input-group.search_bar
+ = f.search_field :name_cont,
+ class: 'form-control',
+ placeholder: t('compliance_checks.filters.name')
+ span.input-group-btn
+ button.btn.btn-default type='submit'
+ span.fa.fa-search
+
+ .ffg-row
+ .form-group.togglable#compliance_check_block-filter
+ = f.label t('activerecord.models.compliance_check_block.one'), required: false, class: 'control-label'
+ = f.input :compliance_check_block_id_eq_any,
+ collection: @compliance_check_set.compliance_check_blocks,
+ as: :check_boxes,
+ label: false,
+ label_method: lambda {|w| ("<span>#{transport_mode_text(w)}</span>").html_safe},
+ required: false,
+ wrapper_html: {class: 'checkbox_list'}
+ .form-group.togglable#subclass-filter
+ = f.label t('compliance_checks.filters.subclass'), required: false, class: 'control-label'
+ = f.input :origin_code_cont_any,
+ collection: subclass_selection_list,
+ as: :check_boxes,
+ label: false,
+ label_method: lambda {|w| ("<span>#{w.first}</span>").html_safe},
+ required: false,
+ wrapper_html: {class: 'checkbox_list'}
+ .form-group.togglable#severity-filter
+ = f.label t('compliance_checks.filters.criticity'), required: false, class: 'control-label'
+ = f.input :criticity_eq_any,
+ collection: ComplianceControl.criticities,
+ as: :check_boxes,
+ label: false,
+ label_method: lambda {|w| ("<span>#{w}</span>").html_safe},
+ required: false,
+ wrapper_html: {class: 'checkbox_list'}
+
+ .actions
+ = link_to t('actions.erase'), @compliance_check_set, class: 'btn btn-link'
+ = f.submit t('actions.filter'), class: 'btn btn-default', id: 'compliance_check_set_compliance_checks_filter_btn'
diff --git a/app/views/compliance_control_sets/show.html.slim b/app/views/compliance_control_sets/show.html.slim
index 2bd663578..12be42ea6 100644
--- a/app/views/compliance_control_sets/show.html.slim
+++ b/app/views/compliance_control_sets/show.html.slim
@@ -25,21 +25,22 @@
= definition_list t('metadatas'),
ComplianceControlSet.human_attribute_name(:name) => @compliance_control_set.name,
I18n.t('activerecord.attributes.compliance_control_set.owner_jdc') => @compliance_control_set.organisation.name
- - if params[:q].present? or @compliance_controls.any?
+
+ - if params[:q].present? || @compliance_controls.any? || @direct_compliance_controls
.row
.col-lg-12
= render '/compliance_controls/filters'
- .row
- .col-lg-12
- h2
- = transport_mode("", "")
- - if @indirect_compliance_controls.try(:any?)
+ - if @direct_compliance_controls.try(:any?)
+ .row
+ .col-lg-12
+ h2
+ = transport_mode_text()
.row
.col-lg-12
.select_table
- = table_builder_2 @indirect_compliance_controls,
+ = table_builder_2 @direct_compliance_controls,
[ \
TableBuilderHelper::Column.new( \
key: :code, \
@@ -71,7 +72,7 @@
.row
.col-lg-12
h2
- = transport_mode(block.transport_mode, block.transport_submode)
+ = transport_mode_text(block)
.btn-group
.btn.dropdown-toggle{ data-toggle="dropdown" }
.span.fa.fa-cog
diff --git a/app/views/compliance_controls/_filters.html.slim b/app/views/compliance_controls/_filters.html.slim
index c729190a0..d38da5d2d 100644
--- a/app/views/compliance_controls/_filters.html.slim
+++ b/app/views/compliance_controls/_filters.html.slim
@@ -1,3 +1,4 @@
+/ Compliance Control Filter
= search_form_for @q_controls_form,
url: compliance_control_set_path(@compliance_control_set),
builder: SimpleForm::FormBuilder,
@@ -19,7 +20,7 @@
collection: @compliance_control_set.compliance_control_blocks,
as: :check_boxes,
label: false,
- label_method: lambda {|w| ("<span>#{transport_mode(w.transport_mode, w.transport_submode)}</span>").html_safe},
+ label_method: lambda {|w| ("<span>#{transport_mode_text(w)}</span>").html_safe},
required: false,
wrapper_html: {class: 'checkbox_list'}
.form-group.togglable#subclass-filter