aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2012-03-12 10:55:01 +0100
committerAlban Peignier2012-03-12 10:55:01 +0100
commit6792aa2c5f368a6147bf930391f0458e362e6160 (patch)
treec511f45bea68b3f0cae85ac308f3f74321f9c07a
parentf4b7200aa74a2723373ce1117d1a5e4400659d82 (diff)
downloadchouette-core-6792aa2c5f368a6147bf930391f0458e362e6160.tar.bz2
Use Chouette::Line#transport_mode. Fixes #1
-rw-r--r--Gemfile.lock2
-rw-r--r--app/views/lines/_form.erb2
-rw-r--r--app/views/lines/show.html.erb2
-rw-r--r--config/locales/transport_modes.yml87
4 files changed, 48 insertions, 45 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 4397ea7b3..13fa6df90 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: git://chouette.dryade.priv/ninoxe
- revision: 96759cedfefcd6e54b0cc57aa9801d3483331b62
+ revision: ac0ec92e6d4b04972e969f20fe623781d787a5f0
specs:
chouette-ninoxe (0.0.8)
GeoRuby
diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb
index ddbffdf55..2329ca75d 100644
--- a/app/views/lines/_form.erb
+++ b/app/views/lines/_form.erb
@@ -15,7 +15,7 @@
<%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%>
<%= form.input :published_name %>
<%= form.input :number %>
- <%= form.input :transport_mode_name, :as => :select, :collection => Chouette::TransportMode.definitions, :include_blank => false, :member_label => Proc.new { |a| t("#{a[0]}") } %>
+ <%= form.input :transport_mode_name, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") } %>
<%= form.input :comment %>
<% end %>
diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb
index 74ed626b0..c2bc9aa10 100644
--- a/app/views/lines/show.html.erb
+++ b/app/views/lines/show.html.erb
@@ -33,7 +33,7 @@
</p>
<p>
<label><%= @line.human_attribute_name("transport_mode_name") %>: </label>
- <%= @line.transport_mode_name %>
+ <%= t("transport_modes.label.#{@line.transport_mode}") %>
</p>
<p>
<label><%= @line.human_attribute_name("comment") %>: </label>
diff --git a/config/locales/transport_modes.yml b/config/locales/transport_modes.yml
index 51bea6b00..0ed6944a0 100644
--- a/config/locales/transport_modes.yml
+++ b/config/locales/transport_modes.yml
@@ -1,44 +1,47 @@
en:
- unknown: unknown
- air: Air
- train: Train
- long_distance_train: Long distance train
- local_train: Local train
- rapid_transit: Rapid transit
- metro: Metro
- tramway: Tramway
- coach: Coach
- bus: Bus
- ferry: Ferry
- waterborne: Waterborne
- private_vehicle: Private vehicle
- walk: Walk
- trolley_bus: Trolleybus
- bicycle: Bicycle
- shuttle: Shuttle
- taxi: Taxi
- val: VAL
- other: Other
-
+ transport_modes:
+ label:
+ unknown: unknown
+ air: Air
+ train: Train
+ long_distance_train: Long distance train
+ local_train: Local train
+ rapid_transit: Rapid transit
+ metro: Metro
+ tramway: Tramway
+ coach: Coach
+ bus: Bus
+ ferry: Ferry
+ waterborne: Waterborne
+ private_vehicle: Private vehicle
+ walk: Walk
+ trolley_bus: Trolleybus
+ bicycle: Bicycle
+ shuttle: Shuttle
+ taxi: Taxi
+ val: VAL
+ other: Other
+
fr:
- unknown: Inconnu
- air: Air
- train: Train
- long_distance_train: Train longue distance
- local_train: Train local
- rapid_transit: Lignes rapides
- metro: Métro
- tramway: Tramway
- coach: Voiture
- bus: Bus
- ferry: Ferry
- waterborne: Eau
- private_vehicle: Véhicule privé
- walk: Piéton
- trolley_bus: Trolley bus
- bicycle: Vélo
- shuttle: Navette
- taxi: Taxi
- val: VAL
- other: Autre
- \ No newline at end of file
+ transport_modes:
+ label:
+ unknown: Inconnu
+ air: Air
+ train: Train
+ long_distance_train: Train longue distance
+ local_train: Train local
+ rapid_transit: Lignes rapides
+ metro: Métro
+ tramway: Tramway
+ coach: Voiture
+ bus: Bus
+ ferry: Ferry
+ waterborne: Eau
+ private_vehicle: Véhicule privé
+ walk: Piéton
+ trolley_bus: Trolley bus
+ bicycle: Vélo
+ shuttle: Navette
+ taxi: Taxi
+ val: VAL
+ other: Autre