aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile.lock2
-rw-r--r--app/views/access_points/_form.html.erb2
-rw-r--r--app/views/access_points/show.html.erb8
-rw-r--r--app/views/stop_areas/_form.html.erb9
-rw-r--r--app/views/stop_areas/show.html.erb8
-rw-r--r--config/environments/development.rb2
-rw-r--r--config/locales/access_points.yml4
-rw-r--r--config/locales/stop_areas.yml4
-rw-r--r--db/migrate/20140820074843_add_zip_code_and_city_name_to_stop_area.ninoxe_engine.rb9
-rw-r--r--db/migrate/20140820074844_add_zip_code_and_city_name_to_access_point.ninoxe_engine.rb9
-rw-r--r--db/schema.rb6
11 files changed, 57 insertions, 6 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 0517b95e3..a9b43d758 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/afimb/ninoxe.git
- revision: 77e18337ad45be656900cc29da85e12c78d46073
+ revision: 5bb26096ba96661c684c76c05dac05deda877937
branch: sismo
specs:
ninoxe (1.1.0)
diff --git a/app/views/access_points/_form.html.erb b/app/views/access_points/_form.html.erb
index 4749943fb..26c80c996 100644
--- a/app/views/access_points/_form.html.erb
+++ b/app/views/access_points/_form.html.erb
@@ -9,6 +9,8 @@
:collection => Chouette::AccessPoint.access_point_types, :include_blank => false, :member_label => Proc.new { |access_point_type| t("access_types.label.#{access_point_type}") } %>
<%= form.input :street_name %>
<%= form.input :country_code %>
+ <%= form.input :zip_code %>
+ <%= form.input :city_name %>
<%= form.input :comment %>
<%= form.input :openning_time, :as => :time_select %>
<%= form.input :closing_time, :as => :time_select %>
diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb
index 132581786..7cd7b4920 100644
--- a/app/views/access_points/show.html.erb
+++ b/app/views/access_points/show.html.erb
@@ -25,6 +25,14 @@
<%= @access_point.country_code %>
</p>
<p>
+ <label><%= @access_point.human_attribute_name("zip_code") %>: </label>
+ <%= @access_point.zip_code %>
+ </p>
+ <p>
+ <label><%= @access_point.human_attribute_name("city_name") %>: </label>
+ <%= @access_point.city_name %>
+ </p>
+ <p>
<label><%= @access_point.human_attribute_name("access_point_type") %>: </label>
<%= t("access_types.label.#{@access_point.access_point_type}") %>
</p>
diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb
index d383c2491..38545e0ea 100644
--- a/app/views/stop_areas/_form.html.erb
+++ b/app/views/stop_areas/_form.html.erb
@@ -28,6 +28,8 @@
<%= form.input :registration_number, :input_html => { :title => t("formtastic.titles.stop_area.registration_number")} %>
<%= form.input :street_name %>
<%= form.input :country_code %>
+ <%= form.input :zip_code %>
+ <%= form.input :city_name %>
<%= form.input :fare_code %>
<%= form.input :nearest_topic_name %>
<%= form.input :comment, :as => :text %>
@@ -92,9 +94,10 @@
);
$('.typeahead').on('typeahead:selected', function($e, datum) {
- $('input[name="stop_area[longitude]"]').val(datum.lon);
- $('input[name="stop_area[latitude]"]').val(datum.lat);
+ $('input[name="stop_area[coordinates]"]').val(datum.lat+","+datum.lon);
+ $('input[name="stop_area[coordinates]"]').change();
$('input[name="stop_area[street_name]"]').val(datum.road);
- $('input[name="stop_area[country_code]"]').val(datum.postcode);
+ $('input[name="stop_area[zip_code]"]').val(datum.postcode);
+ $('input[name="stop_area[city_name]"]').val(datum.city);
})
</script>
diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb
index cd8fca12b..dc2e60349 100644
--- a/app/views/stop_areas/show.html.erb
+++ b/app/views/stop_areas/show.html.erb
@@ -26,6 +26,14 @@
<%= @stop_area.country_code %>
</p>
<p>
+ <label><%= @stop_area.human_attribute_name("zip_code") %>: </label>
+ <%= @stop_area.zip_code %>
+ </p>
+ <p>
+ <label><%= @stop_area.human_attribute_name("city_name") %>: </label>
+ <%= @stop_area.city_name %>
+ </p>
+ <p>
<label><%= @stop_area.human_attribute_name("fare_code") %>: </label>
<%= @stop_area.fare_code %>
</p>
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 08ad82d93..5745766fd 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -45,7 +45,7 @@ ChouetteIhm::Application.configure do
GA.tracker = "UA-AAAAAAAA"
# api key to geoportail IGN (production key link to application url root referer)
- config.geoportail_api_key = "aaaaaaaaaaaaaa"
+ #config.geoportail_api_key = "aaaaaaaaaaaaaa"
# Specific for each company
config.company_name = "afimb"
diff --git a/config/locales/access_points.yml b/config/locales/access_points.yml
index 10d1a3376..d6352253c 100644
--- a/config/locales/access_points.yml
+++ b/config/locales/access_points.yml
@@ -53,6 +53,8 @@ en:
creation_time: "Created on"
creatorid: "Created by"
coordinates: "Coordinates (lat,lng)"
+ zip_code: "Zip code"
+ city_name: "City"
formtastic:
titles:
access_point:
@@ -115,6 +117,8 @@ fr:
creation_time: "Créé le"
creator_id: "Créé par"
coordinates: "Coordonnées (lat,lng)"
+ zip_code: "Code postal"
+ city_name: "Commune"
formtastic:
titles:
access_point:
diff --git a/config/locales/stop_areas.yml b/config/locales/stop_areas.yml
index 47c6c35f4..ccc3d2c5b 100644
--- a/config/locales/stop_areas.yml
+++ b/config/locales/stop_areas.yml
@@ -97,6 +97,8 @@ en:
routing_line_ids: "Attached lines"
parent: "Parent"
coordinates: "Coordinates (lat,lng)"
+ zip_code: "Zip code"
+ city_name: "City"
formtastic:
titles:
stop_area:
@@ -206,6 +208,8 @@ fr:
routing_line_ids: "Lignes affectées par l'ITL"
parent: "Parent"
coordinates: "Coordonnées (lat,lng)"
+ zip_code: "Code postal"
+ city_name: "Commune"
formtastic:
titles:
stop_area:
diff --git a/db/migrate/20140820074843_add_zip_code_and_city_name_to_stop_area.ninoxe_engine.rb b/db/migrate/20140820074843_add_zip_code_and_city_name_to_stop_area.ninoxe_engine.rb
new file mode 100644
index 000000000..47493163a
--- /dev/null
+++ b/db/migrate/20140820074843_add_zip_code_and_city_name_to_stop_area.ninoxe_engine.rb
@@ -0,0 +1,9 @@
+# This migration comes from ninoxe_engine (originally 20140820060801)
+class AddZipCodeAndCityNameToStopArea < ActiveRecord::Migration
+ def change
+ change_table :stop_areas do |t|
+ t.string :zip_code
+ t.string :city_name
+ end
+ end
+end
diff --git a/db/migrate/20140820074844_add_zip_code_and_city_name_to_access_point.ninoxe_engine.rb b/db/migrate/20140820074844_add_zip_code_and_city_name_to_access_point.ninoxe_engine.rb
new file mode 100644
index 000000000..628d0a1d6
--- /dev/null
+++ b/db/migrate/20140820074844_add_zip_code_and_city_name_to_access_point.ninoxe_engine.rb
@@ -0,0 +1,9 @@
+# This migration comes from ninoxe_engine (originally 20140820060814)
+class AddZipCodeAndCityNameToAccessPoint < ActiveRecord::Migration
+ def change
+ change_table :access_points do |t|
+ t.string :zip_code
+ t.string :city_name
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index be5e89c97..6c45bd44a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140721080946) do
+ActiveRecord::Schema.define(:version => 20140820074844) do
create_table "access_links", :force => true do |t|
t.integer "access_point_id", :limit => 8
@@ -57,6 +57,8 @@ ActiveRecord::Schema.define(:version => 20140721080946) do
t.boolean "mobility_restricted_suitability"
t.boolean "stairs_availability"
t.integer "stop_area_id", :limit => 8
+ t.string "zip_code"
+ t.string "city_name"
end
add_index "access_points", ["objectid"], :name => "access_points_objectid_key", :unique => true
@@ -390,6 +392,8 @@ ActiveRecord::Schema.define(:version => 20140721080946) do
t.boolean "stairs_availability"
t.boolean "lift_availability"
t.integer "int_user_needs"
+ t.string "zip_code"
+ t.string "city_name"
end
add_index "stop_areas", ["objectid"], :name => "stop_areas_objectid_key", :unique => true