diff options
| author | Luc Donnet | 2014-09-29 11:10:12 +0200 |
|---|---|---|
| committer | Luc Donnet | 2014-09-29 11:10:12 +0200 |
| commit | 98b4b17dcc44ca0409fa7bb0313be09697a9d71d (patch) | |
| tree | 3d3c97f832c577b934c981d9bea59ea8d8e6bd7e | |
| parent | 8c95b9eb841db3a9dfee3a3538f1ec7e98921039 (diff) | |
| download | chouette-core-98b4b17dcc44ca0409fa7bb0313be09697a9d71d.tar.bz2 | |
Fix locales title for vehicle journey popover Refs #0029047
| -rw-r--r-- | app/helpers/vehicle_journeys_helper.rb | 7 | ||||
| -rw-r--r-- | config/locales/vehicle_journeys.yml | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/helpers/vehicle_journeys_helper.rb b/app/helpers/vehicle_journeys_helper.rb index 1ecfe12b5..2ee8123b5 100644 --- a/app/helpers/vehicle_journeys_helper.rb +++ b/app/helpers/vehicle_journeys_helper.rb @@ -8,6 +8,7 @@ module VehicleJourneysHelper journey_pattern.id end end + def vehicle_name( vehicle) if !vehicle.published_journey_name.blank? vehicle.published_journey_name.first(8) @@ -19,22 +20,25 @@ module VehicleJourneysHelper vehicle.id end end + def missing_time_check( is_present) return "missing" if (is_present && is_present.departure_time.nil?) end + def vehicle_departure(vehicle) first_vjas = vehicle.vehicle_journey_at_stops.first return "" unless first_vjas.departure_time l(first_vjas.departure_time, :format => :hour).gsub( / /, ' ') end + def vehicle_title( vehicle) return t('vehicle_journeys.vehicle_journey.title_stopless', :name => vehicle_name( vehicle)) if vehicle.vehicle_journey_at_stops.empty? first_vjas = vehicle.vehicle_journey_at_stops.first t('vehicle_journeys.vehicle_journey.title', - :name => vehicle_name( vehicle), :stop => first_vjas.stop_point.stop_area.name, :time => vehicle_departure(vehicle)) end + def edit_vehicle_title( vehicle) return t('vehicle_journeys.edit.title_stopless', :name => vehicle_name( vehicle)) if vehicle.vehicle_journey_at_stops.empty? first_vjas = vehicle.vehicle_journey_at_stops.first @@ -43,5 +47,6 @@ module VehicleJourneysHelper :stop => first_vjas.stop_point.stop_area.name, :time => vehicle_departure(vehicle)) end + end diff --git a/config/locales/vehicle_journeys.yml b/config/locales/vehicle_journeys.yml index ff490966b..05eb1c4cb 100644 --- a/config/locales/vehicle_journeys.yml +++ b/config/locales/vehicle_journeys.yml @@ -4,7 +4,7 @@ en: line_routes: "Line's routes" vehicle_journey: title_stopless: "Vehicle journey %{name}" - title: "Vehicle journey %{name} leaving from %{stop} at %{time}" + title: "Vehicle journey leaving from %{stop} at %{time}" actions: index: "Vehicle time's board" new: "Add a new vehicle journey" @@ -105,7 +105,7 @@ fr: line_routes: "Séquences d'arrêts de la ligne" vehicle_journey: title_stopless: "Course %{name}" - title: "Course %{name} partant de %{stop} à %{time}" + title: "Course partant de %{stop} à %{time}" actions: index: "Horaires des courses" new: "Ajouter une course" |
