diff options
24 files changed, 194 insertions, 132 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b1fa3932e..14b6c6846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,13 @@ -# Version 2.4.1 (en développement) +# Version 2.4.1 (13/08/14) * Corrections d'anomalies * L'export GTFS exige que l'indice de ligne soit renseigné (Mantis 26726) * L'import GTFS ne tient pas compte des courses commençant après minuit (Mantis 25824) * Mise en place d'un script produisant l'aide en ligne sous forme de docx (Mantis 26604) - * L'import GTFS plante sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755) + * L'import GTFS ne fonctionne pas sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755) * L'export NeTEx produit un fichier invalide si le champ VersionDate du réseau est vide (Mantis 26434) * Liens cassés dans les pages d'aide (Mantis 26690) - * La validation plante si un arrêt n'est pas géolocalisé (Mantis 26931) - * L'import plante si l'encodage du catalogue d'un ZIP n'est pas compatible UTF-8 (Mantis 27011) + * La validation ne fonctionne pas si un arrêt n'est pas géolocalisé (Mantis 26931) + * L'import ne fonctionne pas si l'encodage du catalogue d'un ZIP n'est pas compatible UTF-8 (Mantis 27011) # Version 2.4.0 (27/05/14) * Corrections d'anomalies @@ -70,7 +70,7 @@ gem 'squeel' gem 'ninoxe', :git => 'https://github.com/afimb/ninoxe.git', :branch => :sismo #gem 'ninoxe',:path => '~/projects/ninoxe' #gem 'ninoxe',:path => '~/workspace/chouette/ninoxe' -#gem 'ninoxe', '~> 1.0.1' +#gem 'ninoxe', '~> 1.0.3' gem 'acts_as_list', '0.1.6' gem "acts_as_tree-1.8", '1.1.0', :require => "acts_as_tree" diff --git a/Gemfile.lock b/Gemfile.lock index 8e33a361f..316d89ab8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/afimb/ninoxe.git - revision: 71e72c8df6c4ac353611af4f8b8eb31287a9ddce + revision: 5bb26096ba96661c684c76c05dac05deda877937 branch: sismo specs: ninoxe (1.1.0) diff --git a/app/assets/javascripts/access_points.js.coffee b/app/assets/javascripts/access_points.js.coffee index 5cff80b7c..ee5e89def 100644 --- a/app/assets/javascripts/access_points.js.coffee +++ b/app/assets/javascripts/access_points.js.coffee @@ -1,34 +1,33 @@ jQuery -> x_y_change = (event) -> - if referential_projection != undefined - referential_point = new OpenLayers.Geometry.Point($('input#access_point_longitude').val(), $('input#access_point_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), referential_projection ) - - $('input#access_point_projection_x').val(referential_point.x) - $('input#access_point_projection_y').val(referential_point.y) - - feature = map.getLayersByName("access_point")[0].getFeatureByFid($('input#access_point_id').val()) - google_point = new OpenLayers.LonLat($('input#access_point_longitude').val(), $('input#access_point_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) - feature.move(google_point) - map.setCenter(google_point, 16, false, true) + c = $('input#access_point_coordinates').val().split(",") + if c.length == 2 + if referential_projection != undefined + referential_point = new OpenLayers.Geometry.Point(c[1], c[0]).transform(new OpenLayers.Projection("EPSG:4326"), referential_projection ) + + $('input#access_point_projection_xy').val(referential_point.x.toString()+","+referential_point.y.toString()) + + feature = map.getLayersByName("access_point")[0].getFeatureByFid($('input#access_point_id').val()) + google_point = new OpenLayers.LonLat(c[1], c[0]).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) - $('input#access_point_longitude').change(x_y_change) - $('input#access_point_latitude').change(x_y_change) + $('input#access_point_coordinates').change(x_y_change) lon_lat_change = (event) -> - if referential_projection != undefined - wgs84_point = new OpenLayers.Geometry.Point($('input#access_point_projection_x').val(), $('input#access_point_projection_y').val()).transform(referential_projection, new OpenLayers.Projection("EPSG:4326")) - - $('input#access_point_longitude').val( wgs84_point.x) - $('input#access_point_latitude').val( wgs84_point.y) - - feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#access_point_id').val()) - google_point = new OpenLayers.LonLat(wgs84_point.x, wgs84_point.y).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) - feature.move(google_point) - map.setCenter(google_point, 16, false, true) - - $('input#access_point_projection_x').change(lon_lat_change) - $('input#access_point_projection_y').change(lon_lat_change) + c = $('input#access_point_projection_xy').val().split(",") + if c.length == 2 + if referential_projection != undefined + wgs84_point = new OpenLayers.Geometry.Point(c[0], c[1]).transform(referential_projection, new OpenLayers.Projection("EPSG:4326")) + + $('input#access_point_coordinates').val( wgs84_point.y.toString()+","+wgs84_point.x) + feature = map.getLayersByName("access_point")[0].getFeatureByFid($('input#access_point_id').val()) + google_point = new OpenLayers.LonLat(wgs84_point.x, wgs84_point.y).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) + + $('input#access_point_projection_xy').change(lon_lat_change) # switch visibility of access_links switch_generics = (event) -> diff --git a/app/assets/javascripts/stop_areas/edit.js.coffee b/app/assets/javascripts/stop_areas/edit.js.coffee index 44f6da982..d1d945ebf 100644 --- a/app/assets/javascripts/stop_areas/edit.js.coffee +++ b/app/assets/javascripts/stop_areas/edit.js.coffee @@ -1,31 +1,31 @@ $(".stop_areas.edit").ready -> x_y_change = (event) -> - if referential_projection != undefined - referential_point = new OpenLayers.Geometry.Point($('input#stop_area_longitude').val(), $('input#stop_area_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), referential_projection ) - - $('input#stop_area_projection_x').val(referential_point.x) - $('input#stop_area_projection_y').val(referential_point.y) - - feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#stop_area_id').val()) - google_point = new OpenLayers.LonLat($('input#stop_area_longitude').val(), $('input#stop_area_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) - feature.move(google_point) - map.setCenter(google_point, 16, false, true) + c = $('input#stop_area_coordinates').val().split(",") + if c.length == 2 + if referential_projection != undefined + referential_point = new OpenLayers.Geometry.Point(c[1], c[0]).transform(new OpenLayers.Projection("EPSG:4326"), referential_projection ) + + $('input#stop_area_projection_xy').val(referential_point.x.toString()+","+referential_point.y.toString()) + + feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#stop_area_id').val()) + google_point = new OpenLayers.LonLat(c[1], c[0]).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) - $('input#stop_area_longitude').change(x_y_change) - $('input#stop_area_latitude').change(x_y_change) + $('input#stop_area_coordinates').change(x_y_change) lon_lat_change = (event) -> - if referential_projection != undefined - wgs84_point = new OpenLayers.Geometry.Point($('input#stop_area_projection_x').val(), $('input#stop_area_projection_y').val()).transform(referential_projection, new OpenLayers.Projection("EPSG:4326")) - - $('input#stop_area_longitude').val( wgs84_point.x) - $('input#stop_area_latitude').val( wgs84_point.y) + c = $('input#stop_area_projection_xy').val().split(",") + if c.length == 2 + if referential_projection != undefined + wgs84_point = new OpenLayers.Geometry.Point(c[0], c[1]).transform(referential_projection, new OpenLayers.Projection("EPSG:4326")) + + $('input#stop_area_coordinates').val( wgs84_point.y.toString()+","+wgs84_point.x) + + feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#stop_area_id').val()) + google_point = new OpenLayers.LonLat(wgs84_point.x, wgs84_point.y).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) - feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#stop_area_id').val()) - google_point = new OpenLayers.LonLat(wgs84_point.x, wgs84_point.y).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) - feature.move(google_point) - map.setCenter(google_point, 16, false, true) - - $('input#stop_area_projection_x').change(lon_lat_change) - $('input#stop_area_projection_y').change(lon_lat_change) + $('input#stop_area_projection_xy').change(lon_lat_change) diff --git a/app/maps/access_point_map.rb b/app/maps/access_point_map.rb index f31dcf5a3..0103d9edb 100644 --- a/app/maps/access_point_map.rb +++ b/app/maps/access_point_map.rb @@ -10,10 +10,10 @@ class AccessPointMap < ApplicationMap end def customize_map(map, page) - page.assign "parent_layer", kml_layer(access_point.stop_area, :style_map => Design::StopAreasStyleMap.new(helpers).style_map) - page << map.add_layer(:parent_layer) page.assign "edit_access_point_layer", kml_layer(access_point, { :default => editable? }, :style_map => Design::EditAccessPointStyleMap.new(helpers).style_map) page << map.add_layer(:edit_access_point_layer) + page.assign "parent_layer", kml_layer(access_point.stop_area, :style_map => Design::StopAreasStyleMap.new(helpers).style_map) + page << map.add_layer(:parent_layer) if editable? @@ -23,14 +23,12 @@ class AccessPointMap < ApplicationMap edit_access_point_layer.events.on({ 'afterfeaturemodified': function(event) { geometry = event.feature.geometry.clone().transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326")); - $('#access_point_longitude').val(geometry.x); - $('#access_point_latitude').val(geometry.y); + $('#access_point_coordinates').val(geometry.y.toString()+ ","+ geometry.x.toString()); if(referential_projection != undefined) { projection_geometry = event.feature.geometry.clone().transform(new OpenLayers.Projection("EPSG:900913"), referential_projection ); - $('#access_point_projection_x').val(projection_geometry.x); - $('#access_point_projection_y').val(projection_geometry.y); } + $('#access_point_projection_xy').val(projection_geometry.x.toString()+ ","+ projection_geometry.y.toString()); } } }); EOF diff --git a/app/maps/stop_area_map.rb b/app/maps/stop_area_map.rb index 6c3dd5feb..3fff4a110 100644 --- a/app/maps/stop_area_map.rb +++ b/app/maps/stop_area_map.rb @@ -34,14 +34,12 @@ class StopAreaMap < ApplicationMap edit_stop_area_layer.events.on({ 'afterfeaturemodified': function(event) { geometry = event.feature.geometry.clone().transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326")); - $('#stop_area_longitude').val(geometry.x); - $('#stop_area_latitude').val(geometry.y); + $('#stop_area_coordinates').val(geometry.y.toString()+ ","+ geometry.x.toString()); if(referential_projection != undefined) { projection_geometry = event.feature.geometry.clone().transform(new OpenLayers.Projection("EPSG:900913"), referential_projection ); - $('#stop_area_projection_x').val(projection_geometry.x); - $('#stop_area_projection_y').val(projection_geometry.y); } + $('#stop_area_projection_xy').val(projection_geometry.x.toString()+ ","+ projection_geometry.y.toString()); } } }); EOF diff --git a/app/models/referential.rb b/app/models/referential.rb index b3c37554f..4209a6fac 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -221,7 +221,7 @@ Rails.application.config.after_initialize do class Chouette::StopArea - attr_accessible :projection_x,:projection_y + attr_accessible :projection_x,:projection_y,:projection_xy attr_accessible :address attr_reader :address @@ -232,24 +232,13 @@ Rails.application.config.after_initialize do end # add projection_type set on pre-insert and pre_update action - before_validation :set_projections + before_save :set_projections def set_projections - if ! self.latitude.nil? && ! self.longitude.nil? + if ! self.coordinates.blank? self.long_lat_type = 'WGS84' else self.long_lat_type = nil end -# if ! self.referential.projection_type.nil? && !self.referential.projection_type.empty? -# if ! self.x.nil? && ! self.y.nil? -# self.projection_type = referential.projection_type_label -# else -# self.projection_type = nil -# end -# else -# self.projection_type = nil -# self.x = nil -# self.y = nil -# end end def projection @@ -266,7 +255,6 @@ Rails.application.config.after_initialize do nil else @point ||= GeoRuby::SimpleFeatures::Point::from_lat_lng(Geokit::LatLng.new(self.latitude,self.longitude)).project_to(self.projection.to_i) - @point.x end end @@ -278,39 +266,39 @@ Rails.application.config.after_initialize do @point.y end end + def projection_xy + if self.long_lat_type.nil? || self.projection.nil? + nil + else + @point ||= GeoRuby::SimpleFeatures::Point::from_lat_lng(Geokit::LatLng.new(self.latitude,self.longitude)).project_to(self.projection.to_i) + @point.x.to_s+","+@point.y.to_s + end + end def projection_x=(dummy) # dummy method end def projection_y=(dummy) # dummy method end + def projection_xy=(dummy) + # dummy method + end end Chouette::AccessPoint class Chouette::AccessPoint - attr_accessible :projection_x,:projection_y + attr_accessible :projection_x,:projection_y,:projection_xy # add projection_type set on pre-insert and pre_update action - before_validation :set_projections + before_save :set_projections def set_projections - if ! self.latitude.nil? && ! self.longitude.nil? + if ! self.coordinates.blank? self.long_lat_type = 'WGS84' else self.long_lat_type = nil end -# if ! self.referential.projection_type.nil? && !self.referential.projection_type.empty? -# if ! self.x.nil? && ! self.y.nil? -# self.projection_type = referential.projection_type_label -# else -# self.projection_type = nil -# end -# else -# self.projection_type = nil -# self.x = nil -# self.y = nil -# end end def projection @@ -327,7 +315,6 @@ Rails.application.config.after_initialize do nil else @point ||= GeoRuby::SimpleFeatures::Point::from_lat_lng(Geokit::LatLng.new(self.latitude,self.longitude)).project_to(self.projection.to_i) - @point.x end end @@ -339,12 +326,23 @@ Rails.application.config.after_initialize do @point.y end end + def projection_xy + if self.long_lat_type.nil? || self.projection.nil? + nil + else + @point ||= GeoRuby::SimpleFeatures::Point::from_lat_lng(Geokit::LatLng.new(self.latitude,self.longitude)).project_to(self.projection.to_i) + @point.x.to_s+","+@point.y.to_s + end + end def projection_x=(dummy) # dummy method end def projection_y=(dummy) # dummy method end + def projection_xy=(dummy) + # dummy method + end end end diff --git a/app/models/user.rb b/app/models/user.rb index 1b9ec7416..ae6cceeee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -17,6 +17,7 @@ class User < ActiveRecord::Base before_validation(:on => :create) do self.password ||= Devise.friendly_token.first(6) + self.password_confirmation ||= self.password end # remove organisation and referentials if last user of it diff --git a/app/views/access_points/_form.html.erb b/app/views/access_points/_form.html.erb index b124f9237..1132f65eb 100644 --- a/app/views/access_points/_form.html.erb +++ b/app/views/access_points/_form.html.erb @@ -9,29 +9,29 @@ :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_picker, :input_html => { :class => "form-control input-sm dateselect-time"}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> <%= form.input :closing_time, :as => :time_picker, :input_html => { :class => "form-control input-sm dateselect-time"}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %> <%= form.input :mobility_restricted_suitability,:as => :boolean %> <%= form.input :stairs_availability,:as => :boolean %> <%= form.input :lift_availability,:as => :boolean %> - <%= form.input :objectid, :required => !@access_point.new_record? %> + <%= form.input :objectid, :required => !@access_point.new_record?, :input_html => { :title => t("formtastic.titles.access_point.objectid")} %> <%= form.inputs :name => t('access_points.show.geographic_data') do %> <% if ! @referential.projection_type_label.empty? %> <div class="panel panel-default"> - <div class="panel-heading">@referential.projection_type_label</div> + <div class="panel-heading"><%= @referential.projection_type_label %></div> <div class="panel-body"> - <%= form.input :projection_x %> - <%= form.input :projection_y %> + <%= form.input :projection_xy, :input_html => { :title => t("formtastic.titles.access_point.projection_xy")} %> </div> </div> <% end %> <div class="panel panel-default"> <div class="panel-heading">WGS84</div> <div class="panel-body"> - <%= form.input :longitude %> - <%= form.input :latitude %> + <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles.access_point.coordinates")} %> </div> </div> <% end %> diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb index d674ef88b..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> @@ -85,10 +93,6 @@ </p> <% end %> <% end %> - <p> - <label><%= @access_point.human_attribute_name("objectid") %>: </label> - <%= @access_point.objectid %> - </p> </div> </div> @@ -133,6 +137,7 @@ <% content_for :sidebar do %> <ul class="actions"> + <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> <li><%= link_to t('access_points.actions.edit'), edit_referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :class => "edit" %></li> <li><%= link_to t('access_points.actions.destroy'), referential_stop_area_access_point_path(@referential, @stop_area, @access_point), :method => :delete, :data => {:confirm => t('access_points.actions.destroy_confirm')}, :class => "remove" %></li> </ul> diff --git a/app/views/help/index.textile b/app/views/help/index.textile index 8907abe4d..3e0af420b 100644 --- a/app/views/help/index.textile +++ b/app/views/help/index.textile @@ -30,8 +30,11 @@ h4. Version 2.4.1 ** L'export GTFS exige que l'indice de ligne soit renseigné (Mantis 26726) ** L'import GTFS ne tient pas compte des courses commençant après minuit (Mantis 25824) ** Mise en place d'un script produisant l'aide en ligne sous forme de docx (Mantis 26604) -** L'import GTFS plante sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755) +** L'import GTFS ne fonctionne pas sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755) ** L'export NeTEx produit un fichier invalide si le champ VersionDate du réseau est vide (Mantis 26434) +** Liens cassés dans les pages d'aide (Mantis 26690) +** La validation ne fonctionne pas si un arrêt n'est pas géolocalisé (Mantis 26931) +** L'import ne fonctionne pas si l'encodage du catalogue d'un ZIP n'est pas compatible UTF-8 (Mantis 27011) h4. Version 2.4.0 diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb index 508593d07..ff4a4403e 100644 --- a/app/views/routes/_form.html.erb +++ b/app/views/routes/_form.html.erb @@ -13,9 +13,11 @@ <%= form.semantic_fields_for :stop_points, :include_id => false, :label => "TOTO" do |p| %> <%= render "stop_point_fields", :f => p, :test1 => "oiuoiu" %> <% end %> - <div class="links"> + <div class="links"> <%= link_to_add_association t("routes.actions.add_stop_point"), form, :stop_points, :class => 'add_stop_point' %> - </div> + <br/> + <%= link_to t('routes.actions.new_stop_point'), new_referential_stop_area_path(@referential), {:class => "add", :target => "_blank"} %> + </div> </div> <%= form.actions do %> diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index a51c11da5..38545e0ea 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -15,21 +15,21 @@ <div class="panel panel-default"> <div class="panel-heading"><%= @referential.projection_type_label %></div> <div class="panel-body"> - <%= form.input :projection_x %> - <%= form.input :projection_y %> + <%= form.input :projection_xy, :input_html => { :title => t("formtastic.titles.stop_area.projection_xy")} %> </div> </div> - <% end %> + <% end %> <div class="panel panel-default"> <div class="panel-heading">WGS84</div> <div class="panel-body"> - <%= form.input :longitude %> - <%= form.input :latitude %> + <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles.stop_area.coordinates")} %> </div> </div> - <%= form.input :registration_number %> + <%= 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 %> @@ -40,7 +40,7 @@ <%= form.input :lift_availability,:as => :boolean %> <% end %> - <%= form.input :objectid, :required => !@stop_area.new_record? %> + <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles.stop_area.objectid")} %> <% end %> @@ -94,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 d812ff4e3..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> @@ -84,10 +92,6 @@ <% end %> <% end %> <% end %> - <p> - <label><%= @stop_area.human_attribute_name("objectid") %>: </label> - <%= @stop_area.objectid %> - </p> </div> </div> <p class="after_map" /> @@ -110,6 +114,7 @@ <table> <tr><td> <ul class="actions"> + <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li> <li><%= link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), :class => "edit" %></li> <li><%= link_to t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "remove" %></li> </ul> 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 470a6914b..d6352253c 100644 --- a/config/locales/access_points.yml +++ b/config/locales/access_points.yml @@ -41,6 +41,7 @@ en: projection: "Projection type" projection_x: "x-position" projection_y: "y-position" + projection_xy: "position (x,y)" long_lat_type: "Projection type" longitude: "Longitude" latitude: "Latitude" @@ -51,10 +52,15 @@ en: object_version: "Version" creation_time: "Created on" creatorid: "Created by" + coordinates: "Coordinates (lat,lng)" + zip_code: "Zip code" + city_name: "City" formtastic: - hints: + titles: access_point: objectid: "[prefix]:AccessPoint:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" + coordinates: "latitude,longitude in WGS84 referential, dot for decimal separator" + projection_xy: "x,y in secondary referential, dot for decimal separator" fr: access_points: @@ -97,6 +103,7 @@ fr: projection: "Projection" projection_x: "Position X" projection_y: "Position Y" + projection_xy: "Position (x,y)" long_lat_type: "Projection" longitude: "Longitude" latitude: "Latitude" @@ -109,9 +116,14 @@ fr: object_version: "Version" creation_time: "Créé le" creator_id: "Créé par" + coordinates: "Coordonnées (lat,lng)" + zip_code: "Code postal" + city_name: "Commune" formtastic: - hints: + titles: access_point: objectid: "[prefixe]:AccessPoint:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" + coordinates: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" + projection_xy: "x,y dans le référentiel secondaire, le séparateur de décimales est 'point'" diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml index 08a82a11d..a324dc481 100644 --- a/config/locales/referentials.yml +++ b/config/locales/referentials.yml @@ -70,8 +70,8 @@ en: referential: slug: "only lowercase alphanumerical or underscore characters, first character must be a letter" prefix: "only alphanumerical or underscore characters" - upper_corner: "longitude,latitude in WGS84 referential, dot for decimal separator" - lower_corner: "longitude,latitude in WGS84 referential, dot for decimal separator" + upper_corner: "latitude,longitude in WGS84 referential, dot for decimal separator" + lower_corner: "latitude,longitude in WGS84 referential, dot for decimal separator" fr: referentials: @@ -145,5 +145,5 @@ fr: referential: slug: "caractères autorisés : alphanumériques minuscules et 'souligné' et doit commencer par une lettre" prefix: "caractères autorisés : alphanumériques et 'souligné'" - upper_corner: "longitude,latitude dans le référentiel WGS84, le séparateur de décimales est 'point'" - lower_corner: "longitude,latitude dans le référentiel WGS84, le séparateur de décimales est 'point'" + upper_corner: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" + lower_corner: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" diff --git a/config/locales/routes.yml b/config/locales/routes.yml index 8ec0c876d..623b9d9fc 100644 --- a/config/locales/routes.yml +++ b/config/locales/routes.yml @@ -9,6 +9,8 @@ en: export_kml_all: "Export KML routes" export_hub: "Export HUB route" export_hub_all: "Export HUB routes" + add_stop_point: "Add stop point" + new_stop_point: "Create new stop" new: title: "Add a new route" edit: @@ -72,6 +74,8 @@ fr: export_kml_all: "Export KML des séquences d'arrêts" export_hub: "Export HUB de la séquence d'arrêts" export_hub_all: "Export HUB des séquences d'arrêts" + add_stop_point: "Ajouter un arrêt" + new_stop_point: "Créer un arrêt pour l'ajouter" new: title: "Ajouter une séquence d'arrêts" edit: diff --git a/config/locales/stop_areas.yml b/config/locales/stop_areas.yml index ed3f8ce97..ccc3d2c5b 100644 --- a/config/locales/stop_areas.yml +++ b/config/locales/stop_areas.yml @@ -84,6 +84,7 @@ en: projection: "Projection type" projection_x: "x-position" projection_y: "y-position" + projection_xy: "position (x,y)" long_lat_type: "Projection type" longitude: "Longitude" latitude: "Latitude" @@ -95,11 +96,16 @@ en: routing_stop_ids: "Attached stops" routing_line_ids: "Attached lines" parent: "Parent" + coordinates: "Coordinates (lat,lng)" + zip_code: "Zip code" + city_name: "City" formtastic: - hints: + titles: stop_area: registration_number: "only alphanumerical or underscore characters" objectid: "[prefix]:StopArea:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character" + coordinates: "latitude,longitude in WGS84 referential, dot for decimal separator" + projection_xy: "x,y in secondary referential, dot for decimal separator" fr: stop_areas: @@ -189,6 +195,7 @@ fr: projection: "Projection" projection_x: "Position X" projection_y: "Position Y" + projection_xy: "Position (x,y)" long_lat_type: "Projection" longitude: "Longitude" latitude: "Latitude" @@ -200,10 +207,15 @@ fr: routing_stop_ids: "Arrêts concernés par l'ITL" routing_line_ids: "Lignes affectées par l'ITL" parent: "Parent" + coordinates: "Coordonnées (lat,lng)" + zip_code: "Code postal" + city_name: "Commune" formtastic: - hints: + titles: stop_area: registration_number: "caractères autorisés : alphanumériques et 'souligné'" objectid: "[prefixe]:StopArea:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'" + coordinates: "latitude,longitude dans le référentiel WGS84, le séparateur de décimales est 'point'" + projection_xy: "x,y dans le référentiel secondaire, le séparateur de décimales est 'point'" 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 diff --git a/lib/tasks/userdoc.rake b/lib/tasks/userdoc.rake index 1023aa681..df72c32e4 100644 --- a/lib/tasks/userdoc.rake +++ b/lib/tasks/userdoc.rake @@ -1,4 +1,5 @@ #encoding: utf-8 +if Rails.env != 'production' require 'fileutils' require 'nokogiri' @@ -129,4 +130,5 @@ namespace :doc do end +end |
