diff options
| author | Xinhui | 2017-03-14 10:18:49 +0100 |
|---|---|---|
| committer | Xinhui | 2017-03-14 10:18:49 +0100 |
| commit | 06fc0b9d3266f5e94a704c7a2b8fb339af195912 (patch) | |
| tree | bcc26e99a40aa78e33d9a2cef95c341fc62f5174 | |
| parent | 872341c98ccb2cf49975cd75b3de84ebb4e3f957 (diff) | |
| download | chouette-core-06fc0b9d3266f5e94a704c7a2b8fb339af195912.tar.bz2 | |
Wip fix stop_areas#index search should combine all search fields
Refs #2755
| -rw-r--r-- | app/views/stop_areas/_filters.html.slim | 23 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 12 | ||||
| -rw-r--r-- | config/locales/stop_areas.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/stop_areas.fr.yml | 2 |
4 files changed, 18 insertions, 21 deletions
diff --git a/app/views/stop_areas/_filters.html.slim b/app/views/stop_areas/_filters.html.slim index 1efa66890..dda6eff6b 100644 --- a/app/views/stop_areas/_filters.html.slim +++ b/app/views/stop_areas/_filters.html.slim @@ -1,12 +1,17 @@ -= search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), class: 'form form-filter', html: {method: :get} do |f| - = f.input :zip_code_cont, placeholder: t('.zip_code'), label: @stop_areas.human_attribute_name(:zip_code), required: false += search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), html: {method: :get} 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 - = f.input :city_name_cont, placeholder: t('.city_name'), label: @stop_areas.human_attribute_name(:city_name), required: false + = 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 - .form-group.togglable - = 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' } + .form-group.togglable + = 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/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index 4ca3007ed..830f96270 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -15,15 +15,7 @@ .row .col-lg-12 - = search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), html: {method: :get} 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 - - = render 'filters' + = render 'filters' - if @stop_areas.any? .row @@ -34,7 +26,7 @@ [:show, :edit, :delete], [], 'table has-filter has-search' - + = new_pagination @stop_areas, 'pull-right' - unless @stop_areas.any? diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index 44ce1f12e..d95f76467 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -31,6 +31,7 @@ en: export_hub_commercial: "Export HUB commercial stop points" export_hub_physical: "Export HUB physical" filters: + name_or_objectid: "Search by name or by objectid..." zip_code: Type a zip code... city_name: Type a city name... area_type: Type an area type... @@ -56,7 +57,6 @@ en: index: title: "Stop areas" name: "Search by name..." - name_or_objectid: "Search by name or by objectid..." zip_code: "Zip Code" city_name: "City name" selection: "Filter on" diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index 935f8c73d..88ec580d2 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -31,6 +31,7 @@ fr: export_hub_commercial: "Export HUB des arrêts commerciaux" export_hub_physical: "Export HUB des arrêts physiques" filters: + name_or_objectid: "Recherche par nom ou par objectid..." zip_code: Indiquez un code postal... city_name: Indiquez un nom de commune... area_type: Indiquez un type d'arrêt... @@ -61,7 +62,6 @@ fr: access_link_legend_2: "cliquer sur les flêches pour créer/éditer un lien" index: name: "Recherche par nom..." - name_or_objectid: "Recherche par nom ou par objectid..." zip_code: "Code Postal" city_name: "Commune" title: "Arrêts" |
