From bdeb36005106c099ee3fa831604082ef9df2f27c Mon Sep 17 00:00:00 2001 From: Xinhui Date: Fri, 20 Oct 2017 14:51:08 +0200 Subject: Breadcrumb for routes --- app/controllers/routes_controller.rb | 3 --- app/views/routes/edit.html.slim | 1 + app/views/routes/new.html.slim | 1 + app/views/routes/show.html.slim | 3 ++- config/breadcrumbs.rb | 11 ++++++++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index 78daffb30..93f30f4d5 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -19,7 +19,6 @@ class RoutesController < ChouetteController def edit_boarding_alighting @route = route - build_breadcrumb :edit end def save_boarding_alighting @@ -51,8 +50,6 @@ class RoutesController < ChouetteController @route_sp, with: StopPointDecorator ) - - build_breadcrumb :show end end diff --git a/app/views/routes/edit.html.slim b/app/views/routes/edit.html.slim index 850588aef..12276b64c 100644 --- a/app/views/routes/edit.html.slim +++ b/app/views/routes/edit.html.slim @@ -1,3 +1,4 @@ +- breadcrumb :route, @referential, @line, @route / PageHeader = pageheader 'itineraire', @route.name, diff --git a/app/views/routes/new.html.slim b/app/views/routes/new.html.slim index a68f8ae4e..3a8ceb963 100644 --- a/app/views/routes/new.html.slim +++ b/app/views/routes/new.html.slim @@ -1,3 +1,4 @@ +- breadcrumb :referential_line, @referential, @line / PageHeader = pageheader 'itineraire', t('routes.new.title'), diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index 6bd3451cd..c8fbdfe16 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -1,3 +1,4 @@ +- breadcrumb :route, @referential, @line, @route / PageHeader = pageheader 'itineraire', t('routes.index.title', route: @route.name), @@ -78,4 +79,4 @@ = javascript_tag do | window.route = "#{URI.escape(route_json_for_edit(@route))}" -= javascript_pack_tag 'routes/show.js' \ No newline at end of file += javascript_pack_tag 'routes/show.js' diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb index f437af456..1f33274d3 100644 --- a/config/breadcrumbs.rb +++ b/config/breadcrumbs.rb @@ -123,17 +123,22 @@ end crumb :line_footnotes do |referential, line| link line.name, referential_line_footnotes_path(referential, line) - parent :referential_line, line, referential + parent :referential_line, referential, line end crumb :routing_constraint_zones do |referential, line| link I18n.t('routing_constraint_zones.index.title'), referential_line_routing_constraint_zones_path(referential, line) - parent :referential_line, line, referential + parent :referential_line, referential, line end crumb :routing_constraint_zone do |referential, line, routing_constraint_zone| link routing_constraint_zone.name, referential_line_routing_constraint_zone_path(referential, line, routing_constraint_zone) - parent :routing_constraint_zones, line, referential + parent :routing_constraint_zones, referential, line +end + +crumb :route do |referential, line, route| + link I18n.t('routes.index.title', route: route.name), referential_line_route_path(referential, line, route) + parent :referential_line, referential, line end # crumb :compliance_controls do|compliance_control_sets| -- cgit v1.2.3