aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-03-15 15:53:37 +0100
committerjpl2017-03-15 15:53:37 +0100
commit4c15d6d9127c8c5fa187221ab5ad23dd7c8b1127 (patch)
tree1572114bb724631d55d07cb016b859642c11d0a9 /app
parent0e88a03798edc961c9a63b9407c50e07df83ce57 (diff)
downloadchouette-core-4c15d6d9127c8c5fa187221ab5ad23dd7c8b1127.tar.bz2
Refs #2794: fixing new filters integration
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/components/_forms.sass4
-rw-r--r--app/views/lines/_filters.html.slim36
-rw-r--r--app/views/referentials/_filters.html.slim30
-rw-r--r--app/views/stop_areas/_filters.html.slim18
-rw-r--r--app/views/workbenches/_filters.html.slim38
5 files changed, 68 insertions, 58 deletions
diff --git a/app/assets/stylesheets/components/_forms.sass b/app/assets/stylesheets/components/_forms.sass
index 81bc28046..7c2638e79 100644
--- a/app/assets/stylesheets/components/_forms.sass
+++ b/app/assets/stylesheets/components/_forms.sass
@@ -80,7 +80,7 @@ input
// Search bar
.search_bar
position: relative
- background-color: rgba($grey, 0.15)
+ // background-color: rgba($grey, 0.15)
padding: 7px 15px
width: 100%
padding-right: 60%
@@ -503,7 +503,7 @@ table, .table
top: 100%
left: 0
min-width: 100%
- max-height: 300px
+ max-height: 240px
background-color: #fff
color: $darkgrey
box-shadow: 0 0 3px rgba($darkgrey, 0.25)
diff --git a/app/views/lines/_filters.html.slim b/app/views/lines/_filters.html.slim
index 719491dc3..6a5f38ae4 100644
--- a/app/views/lines/_filters.html.slim
+++ b/app/views/lines/_filters.html.slim
@@ -1,25 +1,27 @@
= search_form_for @q, url: line_referential_lines_path(@line_referential), html: {method: :get}, class: 'form form-filter' do |f|
- .input-group.search_bar
- = f.search_field :name_or_objectid_cont, placeholder: t('lines.index.name_or_objectid'), class: 'form-control'
- span.input-group-btn
- button.btn.btn-default#search-btn type='submit'
- span.fa.fa-search
+ .ffg-row
+ .input-group.search_bar
+ = f.search_field :name_or_objectid_cont, placeholder: t('lines.index.name_or_objectid'), class: 'form-control'
+ span.input-group-btn
+ button.btn.btn-default#search-btn type='submit'
+ span.fa.fa-search
- .form-group.togglable
- = f.label @lines.human_attribute_name(:network), required: false, class: 'control-label'
- = f.input :network_id_eq_any, collection: @line_referential.networks.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
+ .ffg-row
+ .form-group.togglable
+ = f.label @lines.human_attribute_name(:network), required: false, class: 'control-label'
+ = f.input :network_id_eq_any, collection: @line_referential.networks.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
- .form-group.togglable
- = f.label @lines.human_attribute_name(:company), required: false, class: 'control-label'
- = f.input :company_id_eq_any, collection: @line_referential.companies.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
+ .form-group.togglable
+ = f.label @lines.human_attribute_name(:company), required: false, class: 'control-label'
+ = f.input :company_id_eq_any, collection: @line_referential.companies.order(name: :asc), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + l.name + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
- .form-group.togglable
- = f.label @lines.human_attribute_name(:transport_mode), required: false, class: 'control-label'
- = f.input :transport_mode_eq_any, collection: Chouette::Line.transport_mode.values, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("enumerize.line.transport_mode.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
+ .form-group.togglable
+ = f.label @lines.human_attribute_name(:transport_mode), required: false, class: 'control-label'
+ = f.input :transport_mode_eq_any, collection: Chouette::Line.transport_mode.values, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("enumerize.line.transport_mode.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
- .form-group.togglable
- = f.label @lines.human_attribute_name(:transport_submode), required: false, class: 'control-label'
- = f.input :transport_submode_eq_any, collection: Chouette::Line.transport_submode.values, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("enumerize.line.transport_submode.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
+ .form-group.togglable
+ = f.label @lines.human_attribute_name(:transport_submode), required: false, class: 'control-label'
+ = f.input :transport_submode_eq_any, collection: Chouette::Line.transport_submode.values, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("enumerize.line.transport_submode.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'}
.actions
= link_to 'Effacer', @workbench, class: 'btn btn-link'
diff --git a/app/views/referentials/_filters.html.slim b/app/views/referentials/_filters.html.slim
index c27620143..eadd72d9f 100644
--- a/app/views/referentials/_filters.html.slim
+++ b/app/views/referentials/_filters.html.slim
@@ -1,21 +1,23 @@
= search_form_for @q, url: referential_path(@referential.id), class: 'form form-filter' do |f|
- .input-group.search_bar
- = f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de ligne'
- span.input-group-btn
- button.btn.btn-default type='submit'
- span.fa.fa-search
+ .ffg-row
+ .input-group.search_bar
+ = f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de ligne'
+ span.input-group-btn
+ button.btn.btn-default type='submit'
+ span.fa.fa-search
- .form-group.togglable
- = f.label @reflines.human_attribute_name(:transport_mode), required: false, class: 'control-label'
- = f.input :transport_mode_eq_any, collection: LineReferential.first.transport_modes, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("transport_modes.label.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
+ .ffg-row
+ .form-group.togglable
+ = f.label @reflines.human_attribute_name(:transport_mode), required: false, class: 'control-label'
+ = f.input :transport_mode_eq_any, collection: LineReferential.first.transport_modes, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("transport_modes.label.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
- .form-group.togglable
- = f.label @reflines.human_attribute_name(:network), required: false, class: 'control-label'
- = f.input :network_id_eq_any, collection: LineReferential.first.networks.order('name').pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.networks.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
+ .form-group.togglable
+ = f.label @reflines.human_attribute_name(:network), required: false, class: 'control-label'
+ = f.input :network_id_eq_any, collection: LineReferential.first.networks.order('name').pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.networks.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
- .form-group.togglable
- = f.label @reflines.human_attribute_name(:company), required: false, class: 'control-label'
- = f.input :company_id_eq_any, collection: LineReferential.first.companies.order('name').pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.companies.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
+ .form-group.togglable
+ = f.label @reflines.human_attribute_name(:company), required: false, class: 'control-label'
+ = f.input :company_id_eq_any, collection: LineReferential.first.companies.order('name').pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.companies.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
.actions
= link_to 'Effacer', @workbench, class: 'btn btn-link'
diff --git a/app/views/stop_areas/_filters.html.slim b/app/views/stop_areas/_filters.html.slim
index 3ce97deaa..b7c57e842 100644
--- a/app/views/stop_areas/_filters.html.slim
+++ b/app/views/stop_areas/_filters.html.slim
@@ -1,10 +1,12 @@
= search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), html: {method: :get}, class: 'form form-filter' do |f|
- .input-group.search_bar
- = f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
- span.input-group-btn
- button.btn.btn-default#search-btn type='submit'
- span.fa.fa-search
+ .ffg-row
+ .input-group.search_bar
+ = f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
+ span.input-group-btn
+ button.btn.btn-default#search-btn type='submit'
+ span.fa.fa-search
+ .ffg-row
= f.input :zip_code_cont, placeholder: t('.zip_code'), label: @stop_areas.human_attribute_name(:zip_code), required: false
= f.input :city_name_cont, placeholder: t('.city_name'), label: @stop_areas.human_attribute_name(:city_name), required: false
@@ -12,6 +14,6 @@
= f.label @stop_areas.human_attribute_name(:area_type), required: false, class: 'control-label'
= f.input :area_type_eq_any, collection: Chouette::StopArea.area_type.options.sort, as: :check_boxes, label: false, label_method: lambda{|w| ("<span>" + t("enumerize.stop_area.area_type.#{w[1]}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' }
- .actions
- = link_to 'Effacer', @workbench, class: 'btn btn-link'
- = f.submit 'Filtrer', class: 'btn btn-default'
+ .actions
+ = link_to 'Effacer', @workbench, class: 'btn btn-link'
+ = f.submit 'Filtrer', class: 'btn btn-default'
diff --git a/app/views/workbenches/_filters.html.slim b/app/views/workbenches/_filters.html.slim
index ad82b3efd..f3e7c7148 100644
--- a/app/views/workbenches/_filters.html.slim
+++ b/app/views/workbenches/_filters.html.slim
@@ -1,23 +1,27 @@
= search_form_for @q, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder, class: 'form form-filter' do |f|
- .input-group.search_bar
- = f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de référentiel'
- span.input-group-btn
- button.btn.btn-default type='submit'
- span.fa.fa-search
- .form-group.togglable
- = f.label @wbench_refs.human_attribute_name(:status), required: false, class: 'control-label'
- = f.input :archived_at_not_null, label: ("<span>Conservé<span class='fa fa-archive'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox_list' }, input_html: { class: 'check_boxes' }
+ .ffg-row
+ .input-group.search_bar
+ = f.search_field :name_cont, class: 'form-control', placeholder: 'Indiquez un nom de référentiel'
+ span.input-group-btn
+ button.btn.btn-default type='submit'
+ span.fa.fa-search
- .form-group.togglable
- = f.label 'Organisation(s)', 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' }
+ .ffg-row
+ .form-group.togglable
+ = f.label @wbench_refs.human_attribute_name(:status), required: false, class: 'control-label'
+ = f.input :archived_at_not_null, label: ("<span>Conservé<span class='fa fa-archive'></span></span>").html_safe, as: :boolean, wrapper_html: { class: 'checkbox_list' }, input_html: { class: 'check_boxes' }
+
+ .form-group.togglable
+ = f.label 'Organisation(s)', 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 @wbench_refs.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 filter_menu-item' }
+ = p.input :end_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date filter_menu-item' }
- .form-group.togglable
- = f.label @wbench_refs.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 filter_menu-item' }
- = p.input :end_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date filter_menu-item' }
.actions
= link_to 'Effacer', @workbench, class: 'btn btn-link'
= f.submit 'Filtrer', class: 'btn btn-default'