aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorAlban Peignier2012-06-29 09:16:46 +0200
committerAlban Peignier2012-06-29 09:16:46 +0200
commitcfa38b6c6593c46fe52f30455c7073e37da3ae97 (patch)
treec53a5684d85b8d85ead29bc652dd989a5bdcc4ac /app/controllers
parente23bf6c2789b174d7ce847270f45d15b8633000c (diff)
downloadchouette-core-cfa38b6c6593c46fe52f30455c7073e37da3ae97.tar.bz2
Use controller as helpers in Map to create correct paths. Refs #4
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/connection_links_controller.rb2
-rw-r--r--app/controllers/journey_patterns_controller.rb3
-rw-r--r--app/controllers/lines_controller.rb2
-rw-r--r--app/controllers/networks_controller.rb2
-rw-r--r--app/controllers/routes_controller.rb2
-rw-r--r--app/controllers/stop_areas_controller.rb9
6 files changed, 11 insertions, 9 deletions
diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb
index 3da6b1417..ab5cbf8ef 100644
--- a/app/controllers/connection_links_controller.rb
+++ b/app/controllers/connection_links_controller.rb
@@ -9,7 +9,7 @@ class ConnectionLinksController < ChouetteController
respond_to :html, :xml, :json
def show
- @map = ConnectionLinkMap.new referential, resource
+ @map = ConnectionLinkMap.new(resource).with_helpers(self)
show!
end
diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb
index d8611d6f9..fe1b601d4 100644
--- a/app/controllers/journey_patterns_controller.rb
+++ b/app/controllers/journey_patterns_controller.rb
@@ -13,13 +13,12 @@ class JourneyPatternsController < ChouetteController
alias_method :route, :parent
def show
- #@map = RouteMap.new referential, route
+ #@map = RouteMap.new(route).with_helpers(self)
@stop_points = resource.stop_points.paginate(:page => params[:page], :per_page => 10)
show!
end
def new_vehicle_journey
- puts resource.inspect
@vehicle_journey = Chouette::VehicleJourney.new(:route_id => route.id)
@vehicle_journey.update_journey_pattern(resource)
render "vehicle_journeys/select_journey_pattern"
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb
index e14baf211..57be0f6b3 100644
--- a/app/controllers/lines_controller.rb
+++ b/app/controllers/lines_controller.rb
@@ -7,7 +7,7 @@ class LinesController < ChouetteController
belongs_to :referential
def show
- @map = LineMap.new referential, resource
+ @map = LineMap.new(resource).with_helpers(self)
@routes = @line.routes
show!
end
diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb
index ce65d158f..6522ad502 100644
--- a/app/controllers/networks_controller.rb
+++ b/app/controllers/networks_controller.rb
@@ -7,7 +7,7 @@ class NetworksController < ChouetteController
belongs_to :referential
def show
- @map = NetworkMap.new referential, resource
+ @map = NetworkMap.new(resource).with_helpers(self)
show!
end
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index fed76f23b..99b9899fa 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -15,7 +15,7 @@ class RoutesController < ChouetteController
end
def show
- @map = RouteMap.new referential, route
+ @map = RouteMap.new(route).with_helpers(self)
@stop_points = route.stop_points.paginate(:page => params[:page], :per_page => 10)
show!
end
diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb
index 55bf713a7..8d68fd1d5 100644
--- a/app/controllers/stop_areas_controller.rb
+++ b/app/controllers/stop_areas_controller.rb
@@ -40,7 +40,7 @@ class StopAreasController < ChouetteController
end
def show
- @map = StopAreaMap.new referential, stop_area
+ map.editable = false
show! do |format|
unless stop_area.position or params[:default]
format.kml {
@@ -54,8 +54,7 @@ class StopAreasController < ChouetteController
def edit
stop_area.position ||= stop_area.default_position
- @map = StopAreaMap.new referential, stop_area
- @map.editable = true
+ map.editable = true
edit!
end
@@ -68,6 +67,10 @@ class StopAreasController < ChouetteController
alias_method :stop_area, :resource
+ def map
+ @map = StopAreaMap.new(stop_area).with_helpers(self)
+ end
+
def collection
@q = parent.present? ? parent.stop_areas.search(params[:q]) : referential.stop_areas.search(params[:q])
@stop_areas ||=