aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/stop_areas
diff options
context:
space:
mode:
authorMichel Etienne2014-08-20 11:04:59 +0200
committerMichel Etienne2014-08-20 11:04:59 +0200
commit59a4755231bc3c13c93d8cd8032e729c97d9c45f (patch)
tree55dccd07d668dfe390bcfda7348fb0471d3b5a52 /app/views/stop_areas
parent3df9b80b408343045a81b4c1817f998ebd5d1a03 (diff)
downloadchouette-core-59a4755231bc3c13c93d8cd8032e729c97d9c45f.tar.bz2
add zip code and city name to stop_area and access_point , Mantis 26825
Diffstat (limited to 'app/views/stop_areas')
-rw-r--r--app/views/stop_areas/_form.html.erb9
-rw-r--r--app/views/stop_areas/show.html.erb8
2 files changed, 14 insertions, 3 deletions
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>