diff options
| author | Xinhui | 2017-03-15 10:50:04 +0100 |
|---|---|---|
| committer | Xinhui | 2017-03-15 10:52:26 +0100 |
| commit | 17263b13ba8fe4070da3b30b8677408b7733cf53 (patch) | |
| tree | 6551a7f21ebbcf0e0e7f470913da673b2d3d5f73 | |
| parent | 12eb65f8cccc1aa0dd18e35c6f3bdebf37df8679 (diff) | |
| download | chouette-core-17263b13ba8fe4070da3b30b8677408b7733cf53.tar.bz2 | |
Wip combine filter in #index views
| -rw-r--r-- | app/views/lines/_filters.html.slim | 8 | ||||
| -rw-r--r-- | app/views/lines/index.html.slim | 8 | ||||
| -rw-r--r-- | app/views/referentials/_filters.html.slim | 6 | ||||
| -rw-r--r-- | app/views/referentials/show.html.slim | 8 | ||||
| -rw-r--r-- | app/views/stop_areas/_filters.html.slim | 2 | ||||
| -rw-r--r-- | app/views/workbenches/_filters.html.slim | 8 | ||||
| -rw-r--r-- | app/views/workbenches/show.html.slim | 7 |
7 files changed, 19 insertions, 28 deletions
diff --git a/app/views/lines/_filters.html.slim b/app/views/lines/_filters.html.slim index e2e3fdf82..719491dc3 100644 --- a/app/views/lines/_filters.html.slim +++ b/app/views/lines/_filters.html.slim @@ -1,4 +1,10 @@ -= search_form_for @q, url: line_referential_lines_path(@line_referential), html: { method: :get}, class: 'form form-filter' do |f| += 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 + .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'} diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim index 8e8a73e1b..39dd4f194 100644 --- a/app/views/lines/index.html.slim +++ b/app/views/lines/index.html.slim @@ -15,14 +15,6 @@ .row .col-lg-12 - = search_form_for @q, url: line_referential_lines_path(@line_referential), html: {method: :get} 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 - = render 'filters' - if @lines.any? diff --git a/app/views/referentials/_filters.html.slim b/app/views/referentials/_filters.html.slim index d3d37d085..c27620143 100644 --- a/app/views/referentials/_filters.html.slim +++ b/app/views/referentials/_filters.html.slim @@ -1,4 +1,10 @@ = 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 + .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' } diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index fa89b220d..e9f58b48f 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -40,14 +40,6 @@ .row .col-lg-12 - = search_form_for @q, url: referential_path(@referential.id) 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 - = render 'filters' - if @reflines.any? diff --git a/app/views/stop_areas/_filters.html.slim b/app/views/stop_areas/_filters.html.slim index dda6eff6b..3ce97deaa 100644 --- a/app/views/stop_areas/_filters.html.slim +++ b/app/views/stop_areas/_filters.html.slim @@ -1,4 +1,4 @@ -= search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), html: {method: :get} do |f| += 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 diff --git a/app/views/workbenches/_filters.html.slim b/app/views/workbenches/_filters.html.slim index 2c9a2ddc6..ad82b3efd 100644 --- a/app/views/workbenches/_filters.html.slim +++ b/app/views/workbenches/_filters.html.slim @@ -1,4 +1,9 @@ = 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' } @@ -13,9 +18,6 @@ = 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' - -/ filtres par: etat, orga, plage de validité, date publi. diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index 880b7d20b..e55a69a1f 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -19,13 +19,6 @@ .row .col-lg-12 - = search_form_for @q, url: workbench_path(@workbench.id), builder: SimpleForm::FormBuilder 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 - = render 'filters' - if @wbench_refs.any? |
