diff options
| -rw-r--r-- | app/controllers/purchase_windows_controller.rb | 4 | ||||
| -rw-r--r-- | app/views/purchase_windows/_filters.html.slim | 6 | ||||
| -rw-r--r-- | app/views/purchase_windows/_form.html.slim | 2 | 
3 files changed, 7 insertions, 5 deletions
| diff --git a/app/controllers/purchase_windows_controller.rb b/app/controllers/purchase_windows_controller.rb index a70535150..4965b14c7 100644 --- a/app/controllers/purchase_windows_controller.rb +++ b/app/controllers/purchase_windows_controller.rb @@ -6,6 +6,8 @@ class PurchaseWindowsController < ChouetteController    defaults :resource_class => Chouette::PurchaseWindow, collection_name: 'purchase_windows', instance_name: 'purchase_window'    belongs_to :referential +  requires_feature :purchase_windows +    def index      index! do        scope = self.ransack_period_range(scope: @purchase_windows, error_message: t('compliance_check_sets.filters.error_period_filter'), query: :overlapping) @@ -47,7 +49,7 @@ class PurchaseWindowsController < ChouetteController    def ransack_contains_date      date =[] -    if params[:q] && !params[:q]['date_ranges(1i)'].empty? +    if params[:q] && params[:q]['date_ranges(1i)'].present?        ['date_ranges(1i)', 'date_ranges(2i)', 'date_ranges(3i)'].each do |key|          date << params[:q][key].to_i          params[:q].delete(key) diff --git a/app/views/purchase_windows/_filters.html.slim b/app/views/purchase_windows/_filters.html.slim index 9c83d20db..6d659a6b5 100644 --- a/app/views/purchase_windows/_filters.html.slim +++ b/app/views/purchase_windows/_filters.html.slim @@ -6,9 +6,9 @@          button.btn.btn-default#search_btn type='submit'            span.fa.fa-search -    .form-group -      = f.label Chouette::PurchaseWindow.human_attribute_name(:date), class: 'control-label' -      = f.input :date_ranges, as: :date, label: false, wrapper_html: { class: 'date smart_date' }, class: 'form-control', include_blank: true +    / .form-group +    /   = f.label Chouette::PurchaseWindow.human_attribute_name(:date), class: 'control-label' +    /   = f.input :date_ranges, as: :date, label: false, wrapper_html: { class: 'date smart_date' }, class: 'form-control', include_blank: true    .actions      = link_to t('actions.erase'), referential_purchase_windows_path, class: 'btn btn-link' diff --git a/app/views/purchase_windows/_form.html.slim b/app/views/purchase_windows/_form.html.slim index 8f3ba769d..7a3aabcf4 100644 --- a/app/views/purchase_windows/_form.html.slim +++ b/app/views/purchase_windows/_form.html.slim @@ -2,7 +2,7 @@    .row      .col-lg-12        = f.input :name -      = f.input :color, as: :select, boolean_style: :inline, collection: Chouette::PurchaseWindow.color.values, input_html: {class: 'color_selector'} +      // = f.input :color, as: :select, boolean_style: :inline, collection: Chouette::PurchaseWindow.color.values, input_html: {class: 'color_selector '}    .separator | 
