aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-10-20 14:51:08 +0200
committerXinhui2017-10-20 15:03:07 +0200
commitbdeb36005106c099ee3fa831604082ef9df2f27c (patch)
treebfd15c0b8f0270b1ddd42ca8e4b58ccb10c998bd
parent8d59f83d7e0cc84f44101d8ad4b9d0d9f452df9a (diff)
downloadchouette-core-bdeb36005106c099ee3fa831604082ef9df2f27c.tar.bz2
Breadcrumb for routes
-rw-r--r--app/controllers/routes_controller.rb3
-rw-r--r--app/views/routes/edit.html.slim1
-rw-r--r--app/views/routes/new.html.slim1
-rw-r--r--app/views/routes/show.html.slim3
-rw-r--r--config/breadcrumbs.rb11
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|