diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/access_links_controller.rb | 23 | ||||
| -rw-r--r-- | app/controllers/access_points_controller.rb | 15 | ||||
| -rw-r--r-- | app/controllers/companies_controller.rb | 21 | ||||
| -rw-r--r-- | app/controllers/compliance_check_tasks_controller.rb | 11 | ||||
| -rw-r--r-- | app/controllers/connection_links_controller.rb | 20 | ||||
| -rw-r--r-- | app/controllers/exports_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/group_of_lines_controller.rb | 18 | ||||
| -rw-r--r-- | app/controllers/import_tasks_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/journey_patterns_controller.rb | 23 | ||||
| -rw-r--r-- | app/controllers/lines_controller.rb | 16 | ||||
| -rw-r--r-- | app/controllers/networks_controller.rb | 17 | ||||
| -rw-r--r-- | app/controllers/routes_controller.rb | 19 | ||||
| -rw-r--r-- | app/controllers/rule_parameter_sets_controller.rb | 21 | ||||
| -rw-r--r-- | app/controllers/stop_area_copies_controller.rb | 5 | ||||
| -rw-r--r-- | app/controllers/stop_areas_controller.rb | 20 |
15 files changed, 218 insertions, 15 deletions
diff --git a/app/controllers/access_links_controller.rb b/app/controllers/access_links_controller.rb index 8c6172a7c..4509de575 100644 --- a/app/controllers/access_links_controller.rb +++ b/app/controllers/access_links_controller.rb @@ -16,7 +16,15 @@ class AccessLinksController < ChouetteController def show @map = AccessLinkMap.new(resource).with_helpers(self) - show! + @access_point = Chouette::AccessPoint.find(params[:access_point_id]) + @access_link = Chouette::AccessLink.find(params[:id]) + @stop_area = @access_link.stop_area + show! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + add_breadcrumb @access_point.name, referential_stop_area_access_point_path(@referential, @stop_area,@access_point) + add_breadcrumb Chouette::AccessLink.model_name.human(:count => 2), access_links_referential_stop_area_path(@referential, @stop_area) + end end def new @@ -34,7 +42,11 @@ class AccessLinksController < ChouetteController data[:name] = name end @access_link = Chouette::AccessLink.new(data) - new! + new! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + add_breadcrumb @access_point.name, referential_stop_area_access_point_path(@referential, @stop_area,@access_point) + end end def create @@ -50,7 +62,12 @@ class AccessLinksController < ChouetteController @access_link = Chouette::AccessLink.find(params[:id]) @stop_area = @access_link.stop_area @orientation = @access_link.link_orientation_type - edit! + edit! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + add_breadcrumb @access_point.name, referential_stop_area_access_point_path(@referential, @stop_area,@access_point) + add_breadcrumb @access_link.name, referential_access_point_access_link_path(@referential, @access_point, @access_link) + end end protected diff --git a/app/controllers/access_points_controller.rb b/app/controllers/access_points_controller.rb index cf7507100..0e06bee19 100644 --- a/app/controllers/access_points_controller.rb +++ b/app/controllers/access_points_controller.rb @@ -30,13 +30,26 @@ class AccessPointsController < ChouetteController } end + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end end + def new + new! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + end + end + def edit access_point.position ||= access_point.default_position map.editable = true - edit! + edit! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + add_breadcrumb @access_point.name, referential_stop_area_access_point_path(@referential, @stop_area,@access_point) + end end diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb index 3b5631a8f..20f84e763 100644 --- a/app/controllers/companies_controller.rb +++ b/app/controllers/companies_controller.rb @@ -14,9 +14,30 @@ class CompaniesController < ChouetteController if collection.out_of_bounds? redirect_to params.merge(:page => 1) end + add_breadcrumb Referential.model_name.human(:count => 2), referentials_path() + add_breadcrumb @referential.name, referential_path(@referential) } end end + + def show + show! do + add_breadcrumb Referential.human_attribute_name("companies"), referential_companies_path(@referential) + end + end + + def new + new! do + add_breadcrumb Referential.human_attribute_name("companies"), referential_companies_path(@referential) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("companies"), referential_companies_path(@referential) + add_breadcrumb @company.name, referential_line_path(@referential, @company) + end + end protected def collection diff --git a/app/controllers/compliance_check_tasks_controller.rb b/app/controllers/compliance_check_tasks_controller.rb index 9acce4510..bf8a670a3 100644 --- a/app/controllers/compliance_check_tasks_controller.rb +++ b/app/controllers/compliance_check_tasks_controller.rb @@ -2,6 +2,17 @@ class ComplianceCheckTasksController < ChouetteController respond_to :html, :js belongs_to :referential + def new + new! do + add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) + end + end + + def show + show! do + add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) + end + end def references @references = referential.send(params[:type]).where("name ilike ?", "%#{params[:q]}%") respond_to do |format| diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb index 3c7dd3ab6..ca34aecdc 100644 --- a/app/controllers/connection_links_controller.rb +++ b/app/controllers/connection_links_controller.rb @@ -22,13 +22,31 @@ class ConnectionLinksController < ChouetteController def show @map = ConnectionLinkMap.new(resource).with_helpers(self) - show! + show! do + add_breadcrumb Referential.human_attribute_name("connection_links"), referential_connection_links_path(@referential) + end end + def new + new! do + add_breadcrumb Referential.human_attribute_name("connection_links"), referential_connection_links_path(@referential) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("connection_links"), referential_connection_links_path(@referential) + add_breadcrumb @connection_link.name, referential_connection_link_path(@referential, @connection_link) + end + end + + def select_areas @connection_link = connection_link @departure = connection_link.departure @arrival = connection_link.arrival + add_breadcrumb Referential.human_attribute_name("connection_links"), referential_connection_links_path(@referential) + add_breadcrumb @connection_link.name, referential_connection_link_path(@referential, @connection_link) end protected diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index ed2ecd329..d5723ff78 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -7,6 +7,7 @@ class ExportsController < ChouetteController def new new! do + add_breadcrumb Referential.human_attribute_name("exports"), referential_exports_path(@referential) available_exports end end @@ -19,6 +20,7 @@ class ExportsController < ChouetteController end def show + add_breadcrumb Referential.human_attribute_name("exports"), referential_exports_path(@referential) show! do |format| format.zip { send_file @export.file, :type => :zip } end diff --git a/app/controllers/group_of_lines_controller.rb b/app/controllers/group_of_lines_controller.rb index 5bbda9b84..7167cc40e 100644 --- a/app/controllers/group_of_lines_controller.rb +++ b/app/controllers/group_of_lines_controller.rb @@ -11,7 +11,9 @@ class GroupOfLinesController < ChouetteController def show @map = GroupOfLineMap.new(resource).with_helpers(self) @lines = resource.lines.order(:name).paginate(:page => params[:page]) - show! + show! do + add_breadcrumb Referential.human_attribute_name("group_of_lines"), referential_group_of_lines_path(@referential) + end end def index @@ -23,12 +25,24 @@ class GroupOfLinesController < ChouetteController } end end + + def new + new! do + add_breadcrumb Referential.human_attribute_name("group_of_lines"), referential_group_of_lines_path(@referential) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("group_of_lines"), referential_group_of_lines_path(@referential) + add_breadcrumb @group_of_line.name, referential_group_of_line_path(@referential, @group_of_line) + end + end def name_filter respond_to do |format| format.json { render :json => filtered_group_of_lines_maps} end - end protected diff --git a/app/controllers/import_tasks_controller.rb b/app/controllers/import_tasks_controller.rb index 1d7e8c3aa..e900c79ce 100644 --- a/app/controllers/import_tasks_controller.rb +++ b/app/controllers/import_tasks_controller.rb @@ -5,12 +5,14 @@ class ImportTasksController < ChouetteController def new new! do + add_breadcrumb Referential.human_attribute_name("import_tasks"), referential_import_tasks_path(@referential) available_imports end end def show show! do + add_breadcrumb Referential.human_attribute_name("import_tasks"), referential_import_tasks_path(@referential) if import_task.completed? @files_stats = import_task.result["files"]["stats"] @files_list = import_task.result["files"]["list"] diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb index 0274b9b71..084f34b03 100644 --- a/app/controllers/journey_patterns_controller.rb +++ b/app/controllers/journey_patterns_controller.rb @@ -27,7 +27,28 @@ class JourneyPatternsController < ChouetteController def show @map = JourneyPatternMap.new(journey_pattern).with_helpers(self) @stop_points = journey_pattern.stop_points.paginate(:page => params[:page]) - show! + show! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + add_breadcrumb @route.name, referential_line_route_path(@referential, @line, @route) + end + end + + def new + new! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + add_breadcrumb @route.name, referential_line_route_path(@referential, @line, @route) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + add_breadcrumb @route.name, referential_line_route_path(@referential, @line, @route) + add_breadcrumb @journey_pattern.name, referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern) + end end def new_vehicle_journey diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 3721a957d..2ff732721 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -22,9 +22,23 @@ class LinesController < ChouetteController @map = LineMap.new(resource).with_helpers(self) @routes = @line.routes @group_of_lines = @line.group_of_lines - show! + show! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + end end + def new + new! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + end + end # overwrite inherited resources to use delete instead of destroy # foreign keys will propagate deletion) def destroy_resource(object) diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index 04d565812..f99ff494b 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -10,7 +10,9 @@ class NetworksController < ChouetteController def show @map = NetworkMap.new(resource).with_helpers(self) - show! + show! do + add_breadcrumb Referential.human_attribute_name("networks"), referential_networks_path(@referential) + end end def index @@ -23,6 +25,19 @@ class NetworksController < ChouetteController end end + def new + new! do + add_breadcrumb Referential.human_attribute_name("networks"), referential_networks_path(@referential) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("networks"), referential_networks_path(@referential) + add_breadcrumb @network.name, referential_line_path(@referential, @network) + end + end + protected def collection diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index 7b5e096db..7d51c47ad 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -18,9 +18,26 @@ class RoutesController < ChouetteController def show @map = RouteMap.new(route).with_helpers(self) @stop_points = route.stop_points.paginate(:page => params[:page]) - show! + show! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + end end + def new + new! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + end + end + + def edit + edit! do + add_breadcrumb Referential.human_attribute_name("lines"), referential_lines_path(@referential) + add_breadcrumb @line.name, referential_line_path(@referential, @line) + add_breadcrumb @route.name, referential_line_route_path(@referential, @line, @route) + end + end # overwrite inherited resources to use delete instead of destroy # foreign keys will propagate deletion) def destroy_resource(object) diff --git a/app/controllers/rule_parameter_sets_controller.rb b/app/controllers/rule_parameter_sets_controller.rb index fbd5281c8..9918e0eb5 100644 --- a/app/controllers/rule_parameter_sets_controller.rb +++ b/app/controllers/rule_parameter_sets_controller.rb @@ -6,7 +6,26 @@ class RuleParameterSetsController < ChouetteController def new @rule_parameter_set = RuleParameterSet.default( @referential) - new! + new! do + add_breadcrumb Referential.human_attribute_name("import_tasks"), referential_import_tasks_path(@referential) + add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) + add_breadcrumb Referential.human_attribute_name("rule_parameter_sets"), referential_rule_parameter_sets_path(@referential) + end + end + + def index + index! do + add_breadcrumb Referential.human_attribute_name("import_tasks"), referential_import_tasks_path(@referential) + add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) + end + end + + def show + show! do + add_breadcrumb Referential.human_attribute_name("import_tasks"), referential_import_tasks_path(@referential) + add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) + add_breadcrumb Referential.human_attribute_name("rule_parameter_sets"), referential_rule_parameter_sets_path(@referential) + end end def destroy diff --git a/app/controllers/stop_area_copies_controller.rb b/app/controllers/stop_area_copies_controller.rb index dbb66c2bd..642932acd 100644 --- a/app/controllers/stop_area_copies_controller.rb +++ b/app/controllers/stop_area_copies_controller.rb @@ -8,7 +8,10 @@ class StopAreaCopiesController < ChouetteController def new @stop_area_copy = StopAreaCopy.new(:hierarchy => params[:hierarchy], :source => parent) - new! + new! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + end end def create diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index ab4900ef1..ca72c362b 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -19,27 +19,37 @@ class StopAreasController < ChouetteController def select_parent @stop_area = stop_area @parent = stop_area.parent + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end def add_children @stop_area = stop_area @children = stop_area.children + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end def add_routing_lines @stop_area = stop_area @lines = stop_area.routing_lines + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end def add_routing_stops @stop_area = stop_area @stops = stop_area.routing_stops + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end def access_links @stop_area = stop_area @generic_access_links = stop_area.generic_access_link_matrix @detail_access_links = stop_area.detail_access_link_matrix + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) end def index @@ -57,7 +67,9 @@ class StopAreasController < ChouetteController def new @map = StopAreaMap.new( Chouette::StopArea.new).with_helpers(self) @map.editable = true - new! + new! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + end end def show @@ -70,6 +82,7 @@ class StopAreasController < ChouetteController } end + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) end end @@ -77,7 +90,10 @@ class StopAreasController < ChouetteController stop_area.position ||= stop_area.default_position map.editable = true - edit! + edit! do + add_breadcrumb Referential.human_attribute_name("stop_areas"), referential_stop_areas_path(@referential) + add_breadcrumb @stop_area.name, referential_stop_area_path(@referential, @stop_area) + end end def default_geometry |
