aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2016-12-01 11:42:21 +0100
committerXinhui2016-12-01 11:47:44 +0100
commit3d089edf386836ed82d27ac26b5fcfda81065e5b (patch)
tree146ff899044fc1be27b6af1d6f7723fe81fef260
parenta46b4c7c0daad4df021e96d58fc7fe0537d0baed (diff)
downloadchouette-core-3d089edf386836ed82d27ac26b5fcfda81065e5b.tar.bz2
Seach stop_areas by objectid
Refs #2032
-rw-r--r--app/views/referential_stop_areas/index.html.slim3
-rw-r--r--app/views/stop_areas/index.html.slim45
-rw-r--r--config/locales/stop_areas.en.yml2
-rw-r--r--config/locales/stop_areas.fr.yml2
4 files changed, 32 insertions, 20 deletions
diff --git a/app/views/referential_stop_areas/index.html.slim b/app/views/referential_stop_areas/index.html.slim
index 42ac267aa..9fae73a37 100644
--- a/app/views/referential_stop_areas/index.html.slim
+++ b/app/views/referential_stop_areas/index.html.slim
@@ -23,6 +23,9 @@
= f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead', style: 'width: 100%'
.col-sm-3
= f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t(".area_type") })
+ .row
+ .col-sm-3
+ = f.text_field :objectid_cont, placeholder: "#{t('.objectid')}", class: 'form-control typeahead', style: 'width: 100%'
#stop_areas
= render 'stop_areas'
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index b234274fa..1ebbee2cf 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -4,26 +4,31 @@
= @country_codes.to_json
= search_form_for @q, url: stop_area_referential_stop_areas_path(@stop_area_referential), remote: true, html: { method: :get, class: "form", id: "search", role: "form"} do |f|
- .well.well-sm
- .input-group
- = f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
-
- .input-group-btn
- button.btn.btn-primary type="submit"
- span.fa.fa-search
-
- a data-toggle="collapse" data-parent="#search" href="#advanced_search"
- i.fa.fa-plus
- = "#{t('.advanced_search')}"
-
-
- #advanced_search.panel-collapse.collapse
- .panel-body
- .row
- .col-sm-3
- = f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead'
- .col-md-5.col-sm-5
- = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { include_blank: t('.area_type') }, { class: 'form-control' })
+ .panel.panel-default
+ .panel-heading
+ .input-group.col-md-9.col-sm-9
+ = f.text_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'
+
+ .input-group-btn
+ button.btn.btn-primary type="submit"
+ span.fa.fa-search
+
+ a data-toggle="collapse" data-parent="#search" href="#advanced_search"
+ i.fa.fa-plus
+ = "#{t('.advanced_search')}"
+
+ #advanced_search.panel-collapse.collapse
+ .panel-body
+ .row
+ .col-sm-3
+ = f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead', style: 'width: 100%'
+ .col-sm-3
+ = f.text_field :city_name_cont, placeholder: "#{t('.city_name')}", class: 'form-control typeahead', style: 'width: 100%'
+ .col-sm-3
+ = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t(".area_type") })
+ .row
+ .col-sm-3
+ = f.text_field :objectid_cont, placeholder: "#{t('.objectid')}", class: 'form-control typeahead', style: 'width: 100%'
#stop_areas
= render 'stop_areas'
diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml
index d06da3e76..4030cf22e 100644
--- a/config/locales/stop_areas.en.yml
+++ b/config/locales/stop_areas.en.yml
@@ -53,6 +53,8 @@ en:
name: "Search by name..."
name_or_objectid: "Search by name or by objectid..."
zip_code: "Zip Code"
+ city_name: "City name"
+ objectid: "Object id"
selection: "Filter on"
selection_all: "All"
area_type: "Area Type"
diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml
index 0015b571d..d776c1e74 100644
--- a/config/locales/stop_areas.fr.yml
+++ b/config/locales/stop_areas.fr.yml
@@ -58,6 +58,8 @@ fr:
name: "Recherche par nom..."
name_or_objectid: "Recherche par nom ou par objectid..."
zip_code: "Code Postal"
+ city_name: "Commune"
+ objectid: "Code interne"
title: "ArrĂȘts"
selection: "Filtrer sur"
selection_all: "Tous"