diff options
| author | Luc Donnet | 2013-07-09 14:43:48 +0200 |
|---|---|---|
| committer | Luc Donnet | 2013-07-09 14:43:48 +0200 |
| commit | ead284b277486b9731e740e7d94e88e09d2f987d (patch) | |
| tree | 1a43099f53490356f1b84a73099b555189d1f1d8 | |
| parent | e52ad80ce9ff36b4669ed7397dc6cb347e61bc5f (diff) | |
| parent | 28793a3848ff0a04e8747ad4c6a684c2537b6565 (diff) | |
| download | chouette-core-ead284b277486b9731e740e7d94e88e09d2f987d.tar.bz2 | |
Merge master
| -rw-r--r-- | app/assets/stylesheets/stop_areas.css.scss | 2 | ||||
| -rw-r--r-- | app/models/export.rb | 2 | ||||
| -rw-r--r-- | app/views/access_points/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/referentials/show.html.erb | 4 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.erb | 5 | ||||
| -rw-r--r-- | app/views/stop_areas/show.html.erb | 24 | ||||
| -rw-r--r-- | config/locales/stop_areas.yml | 6 | ||||
| -rw-r--r-- | db/migrate/20130708084944_add_accessibility_to_stop_areas.ninoxe_engine.rb | 31 | ||||
| -rw-r--r-- | db/schema.rb | 14 |
9 files changed, 73 insertions, 17 deletions
diff --git a/app/assets/stylesheets/stop_areas.css.scss b/app/assets/stylesheets/stop_areas.css.scss index fcfeb9fcf..3c0fd0479 100644 --- a/app/assets/stylesheets/stop_areas.css.scss +++ b/app/assets/stylesheets/stop_areas.css.scss @@ -46,7 +46,6 @@ } .summary{ - height: 400px; p label { font-weight: bold; @@ -54,7 +53,6 @@ } .genealogical{ - margin-top: 20px; .parent{ border: 2px solid black; diff --git a/app/models/export.rb b/app/models/export.rb index 485d56988..0c2f24cde 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -90,7 +90,7 @@ class Export < ActiveRecord::Base @@references_types = [ Chouette::Line, Chouette::Network, Chouette::Company ] cattr_reader :references_types - validates_inclusion_of :references_type, :in => references_types.map(&:to_s), :all_blank => true, :allow_nil => true + validates_inclusion_of :references_type, :in => references_types.map(&:to_s), :allow_blank => true, :allow_nil => true def references if references_relation.present? and reference_ids.present? diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb index b7c8ba391..d674ef88b 100644 --- a/app/views/access_points/show.html.erb +++ b/app/views/access_points/show.html.erb @@ -59,7 +59,7 @@ <% if !@access_point.projection.nil? %> <p> <span class='geo_data'><%= @access_point.human_attribute_name("projection") %>: </span> - <%= @access_point.projection %> + <%= @referential.projection_type_label %> </p> <p> <span class='geo_data'><%= @access_point.human_attribute_name("projection_x") %>: </span> diff --git a/app/views/referentials/show.html.erb b/app/views/referentials/show.html.erb index d8e5dd8df..b2df5b2db 100644 --- a/app/views/referentials/show.html.erb +++ b/app/views/referentials/show.html.erb @@ -11,7 +11,9 @@ </p> <p> <label><%= Referential.human_attribute_name("projection_type") %>: </label> - <%= @referential.projection_type %> + <% if ! @referential.projection_type_label.empty? %> + <%= @referential.projection_type_label %> (epsg:<%= @referential.projection_type %>) + <% end %> </p> <p> <label><%= Referential.human_attribute_name("time_zone").capitalize %>: </label> diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index e649070ab..279ab67f5 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -10,8 +10,10 @@ <%= form.input :fare_code %> <%= form.input :nearest_topic_name %> <%= form.input :comment %> - <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :disabled => !@stop_area.new_record? } %> <% if !manage_itl %> + <%= form.input :mobility_restricted_suitability,:as => :boolean %> + <%= form.input :stairs_availability,:as => :boolean %> + <%= form.input :lift_availability,:as => :boolean %> <%= form.inputs :name => t('stop_areas.show.geographic_data') do %> <% if ! @referential.projection_type_label.empty? %> <%= form.inputs :name => @referential.projection_type_label do %> @@ -25,6 +27,7 @@ <% end %> <% end %> <% end %> + <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :disabled => !@stop_area.new_record? } %> <% end %> <%= form.actions do %> diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb index 632036959..d4e812ace 100644 --- a/app/views/stop_areas/show.html.erb +++ b/app/views/stop_areas/show.html.erb @@ -38,6 +38,18 @@ <%= t("area_types.label.#{@stop_area.stop_area_type}") %> </p> <% if !manage_itl %> + <p> + <label><%= @stop_area.human_attribute_name("mobility_restricted_suitability") %>: </label> + <%= t((@stop_area.mobility_restricted_suitability == true).to_s) %> + </p> + <p> + <label><%= @stop_area.human_attribute_name("stairs_availability") %>: </label> + <%= t((@stop_area.stairs_availability == true).to_s) %> + </p> + <p> + <label><%= @stop_area.human_attribute_name("lift_availability") %>: </label> + <%= t((@stop_area.lift_availability == true).to_s) %> + </p> <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p> <% if @stop_area.long_lat_type == nil %> <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span> @@ -45,7 +57,7 @@ <% if !@stop_area.projection.nil? %> <p> <span class='geo_data'><%= @stop_area.human_attribute_name("projection") %>: </span> - <%= @stop_area.projection %> + <%= @referential.projection_type_label %> </p> <p> <span class='geo_data'><%= @stop_area.human_attribute_name("projection_x") %>: </span> @@ -77,14 +89,14 @@ <%= @stop_area.objectid %> </p> </div> - - <p class="after_map" /> +</div> +<p class="after_map" /> - <div class="genealogical"> +<div class="genealogical"> <%= render "stop_areas/genealogical" %> - </div> - </div> + + <% if manage_access_points %> <p class="after_map" /> diff --git a/config/locales/stop_areas.yml b/config/locales/stop_areas.yml index dfc677a71..a16626404 100644 --- a/config/locales/stop_areas.yml +++ b/config/locales/stop_areas.yml @@ -70,6 +70,9 @@ en: street_name: "Street name" country_code: "INSEE code" fare_code: "Fare code" + mobility_restricted_suitability: "Mobility reduced passenger suitable" + stairs_availability: "Escalator" + lift_availability: "Lift" projection: "Projection type" projection_x: "x-position" projection_y: "y-position" @@ -164,6 +167,9 @@ fr: street_name: "Nom de la rue" country_code: "Code INSEE" fare_code: "Zone tarifaire" + mobility_restricted_suitability: "Accès pour voyageur à mobilité réduite" + stairs_availability: "Escalator" + lift_availability: "Ascenseur" projection: "Projection" projection_x: "Position X" projection_y: "Position Y" diff --git a/db/migrate/20130708084944_add_accessibility_to_stop_areas.ninoxe_engine.rb b/db/migrate/20130708084944_add_accessibility_to_stop_areas.ninoxe_engine.rb new file mode 100644 index 000000000..88654bb05 --- /dev/null +++ b/db/migrate/20130708084944_add_accessibility_to_stop_areas.ninoxe_engine.rb @@ -0,0 +1,31 @@ +# This migration comes from ninoxe_engine (originally 20130708081951) +class AddAccessibilityToStopAreas < ActiveRecord::Migration + def up + unless column_exists? :stop_areas, :mobility_restricted_suitability + add_column :stop_areas, :mobility_restricted_suitability, :boolean + end + unless column_exists? :stop_areas, :stairs_availability + add_column :stop_areas, :stairs_availability, :boolean + end + unless column_exists? :stop_areas, :lift_availability + add_column :stop_areas, :lift_availability, :boolean + end + unless column_exists? :stop_areas, :int_user_needs + add_column :stop_areas, :int_user_needs, :integer + end + end + def down + if column_exists? :stop_areas, :mobility_restricted_suitability + remove_column :stop_areas, :mobility_restricted_suitability + end + if column_exists? :stop_areas, :stairs_availability + remove_column :stop_areas, :stairs_availability + end + if column_exists? :stop_areas, :lift_availability + remove_column :stop_areas, :lift_availability + end + if column_exists? :stop_areas, :int_user_needs + remove_column :stop_areas, :int_user_needs + end + end +end diff --git a/db/schema.rb b/db/schema.rb index f8bbe06f3..f967e6b0a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130628130528) do +ActiveRecord::Schema.define(:version => 20130708084944) do create_table "access_links", :force => true do |t| t.integer "access_point_id", :limit => 8 @@ -361,8 +361,8 @@ ActiveRecord::Schema.define(:version => 20130628130528) do end create_table "stop_areas", :force => true do |t| - t.integer "parent_id", :limit => 8 - t.string "objectid", :null => false + t.integer "parent_id", :limit => 8 + t.string "objectid", :null => false t.integer "object_version" t.datetime "creation_time" t.string "creator_id" @@ -372,11 +372,15 @@ ActiveRecord::Schema.define(:version => 20130628130528) do t.string "registration_number" t.string "nearest_topic_name" t.integer "fare_code" - t.decimal "longitude", :precision => 19, :scale => 16 - t.decimal "latitude", :precision => 19, :scale => 16 + t.decimal "longitude", :precision => 19, :scale => 16 + t.decimal "latitude", :precision => 19, :scale => 16 t.string "long_lat_type" t.string "country_code" t.string "street_name" + t.boolean "mobility_restricted_suitability" + t.boolean "stairs_availability" + t.boolean "lift_availability" + t.integer "int_user_needs" end add_index "stop_areas", ["objectid"], :name => "stop_areas_objectid_key", :unique => true |
