aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorGuillaume2017-09-20 11:31:29 +0200
committerGuillaume2017-09-20 11:31:29 +0200
commit8007f0140f3fc5183e9a3d27b19fe90e4da839d2 (patch)
treea9d3558998dd61f8f1f456280ec56c5b1b786138 /app/views
parent2661aed29a0078bc3984424a6a4225cefc8394f3 (diff)
downloadchouette-core-8007f0140f3fc5183e9a3d27b19fe90e4da839d2.tar.bz2
add ransack filter for compliance_control_sets collection
Diffstat (limited to 'app/views')
-rw-r--r--app/views/compliance_control_sets/_filters.html.slim29
-rw-r--r--app/views/compliance_control_sets/index.html.slim10
2 files changed, 10 insertions, 29 deletions
diff --git a/app/views/compliance_control_sets/_filters.html.slim b/app/views/compliance_control_sets/_filters.html.slim
index 8da629e9c..7ee050636 100644
--- a/app/views/compliance_control_sets/_filters.html.slim
+++ b/app/views/compliance_control_sets/_filters.html.slim
@@ -1,33 +1,10 @@
-= search_form_for @q_for_form, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder, class: 'form form-filter' do |f|
+= search_form_for @q_for_form, url: compliance_control_sets_path, 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('referentials.filters.name')
+ = f.search_field :name_cont, class: 'form-control', placeholder: t('compliance_control_sets.filters.name')
span.input-group-btn
button.btn.btn-default type='submit'
span.fa.fa-search
-
- .ffg-row
- .form-group
- = f.label t('activerecord.models.line.one').upcase, required: false, class: 'control-label'
- = f.input :associated_lines_id_eq, as: :select, collection: @workbench.lines.includes(:company).order(:name), input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': t('referentials.filters.line') }, label: false, label_method: :display_name, wrapper_html: { class: 'select2ed'}
-
- .form-group.togglable
- = f.label Referential.human_attribute_name(:status), required: false, class: 'control-label'
- .form-group.checkbox_list
- = f.input :archived_at_not_null, label: ("<span>#{t('activerecord.attributes.referential.archived_at')}<span class='fa fa-archive'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox-wrapper' }
- = f.input :archived_at_null, label: ("<span>#{t('activerecord.attributes.referential.archived_at_null')}<span class='sb sb-lg sb-preparing'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox-wrapper' }
-
- .form-group.togglable
- = f.label t('activerecord.models.organisation.one'), required: false, class: 'control-label'
- = f.input :organisation_name_eq_any, collection: Organisation.order('name').pluck(:name), as: :check_boxes, label: false, label_method: lambda{|w| ("<span>#{w}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
-
- .form-group.togglable
- = f.label Referential.human_attribute_name(:validity_period), required: false, class: 'control-label'
- .filter_menu
- = f.simple_fields_for :validity_period do |p|
- = p.input :begin_gteq, as: :date, label: t('simple_form.from'), wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @begin_range, include_blank: @begin_range ? false : true
- = p.input :end_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date smart_date filter_menu-item' }, default: @end_range, include_blank: @end_range ? false : true
-
.actions
- = link_to t('actions.erase'), @workbench, class: 'btn btn-link'
+ = link_to t('actions.erase'), @compliance_control_set, class: 'btn btn-link'
= f.submit t('actions.filter'), class: 'btn btn-default', id: 'referential_filter_btn'
diff --git a/app/views/compliance_control_sets/index.html.slim b/app/views/compliance_control_sets/index.html.slim
index fa85c38f7..95833a01c 100644
--- a/app/views/compliance_control_sets/index.html.slim
+++ b/app/views/compliance_control_sets/index.html.slim
@@ -14,7 +14,7 @@
.container-fluid
.row
.col-lg-12
- /= render 'filters'
+ = render 'filters'
.row
.col-lg-12
.select_table
@@ -40,11 +40,15 @@
attribute: 'control_numbers' \
), \
TableBuilderHelper::Column.new( \
- key: :update, \
- attribute: '' \
+ key: :updated_at, \
+ attribute: Proc.new { |n| l(n.updated_at, format: :long) if n.updated_at }, \
) \
],
sortable: true,
cls: 'table has-filter has-search'
+ - unless @compliance_control_sets.any?
+ .row.mt-xs
+ .col-lg-12
+ = replacement_msg t('compliance_control_sets.search_no_results')