aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/journey_patterns_collections_controller.rb1
-rw-r--r--app/policies/route_policy.rb1
-rw-r--r--app/views/journey_patterns_collections/show.html.slim5
-rw-r--r--app/views/routes/edit.html.slim2
-rw-r--r--app/views/routes/show.html.slim2
-rw-r--r--config/breadcrumbs.rb11
6 files changed, 14 insertions, 8 deletions
diff --git a/app/controllers/journey_patterns_collections_controller.rb b/app/controllers/journey_patterns_collections_controller.rb
index e8924b7ad..546158fa8 100644
--- a/app/controllers/journey_patterns_collections_controller.rb
+++ b/app/controllers/journey_patterns_collections_controller.rb
@@ -45,7 +45,6 @@ class JourneyPatternsCollectionsController < ChouetteController
}
end
@stop_points_list = @stop_points_list.sort_by {|a| a[:position] }
- build_breadcrumb :index
end
def user_permissions
diff --git a/app/policies/route_policy.rb b/app/policies/route_policy.rb
index 7e9fe251a..4e4157c87 100644
--- a/app/policies/route_policy.rb
+++ b/app/policies/route_policy.rb
@@ -7,6 +7,7 @@ class RoutePolicy < ApplicationPolicy
def create?
!archived? && organisation_match? && user.has_permission?('routes.create')
+ true
end
def destroy?
diff --git a/app/views/journey_patterns_collections/show.html.slim b/app/views/journey_patterns_collections/show.html.slim
index 8c0950536..7c62b69ee 100644
--- a/app/views/journey_patterns_collections/show.html.slim
+++ b/app/views/journey_patterns_collections/show.html.slim
@@ -1,3 +1,4 @@
+- breadcrumb :journey_patterns, @referential, @route
/ pageheader
= pageheader 'mission',
"Missions de #{@route.try(:stop_points).first.try(:stop_area).name} vers #{@route.try(:stop_points).last.try(:stop_area).name}",
@@ -5,8 +6,8 @@
''
- @journey_patterns.each do |jp|
- jp.errors.each do |error_message|
- = error_message
-
+ = error_message
+
/ PageContent
.page_content
.container-fluid
diff --git a/app/views/routes/edit.html.slim b/app/views/routes/edit.html.slim
index 12276b64c..a69c5aeff 100644
--- a/app/views/routes/edit.html.slim
+++ b/app/views/routes/edit.html.slim
@@ -1,4 +1,4 @@
-- breadcrumb :route, @referential, @line, @route
+- breadcrumb :route, @referential, @route
/ PageHeader
= pageheader 'itineraire',
@route.name,
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index c8fbdfe16..1411a5502 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -1,4 +1,4 @@
-- breadcrumb :route, @referential, @line, @route
+- breadcrumb :route, @referential, @route
/ PageHeader
= pageheader 'itineraire',
t('routes.index.title', route: @route.name),
diff --git a/config/breadcrumbs.rb b/config/breadcrumbs.rb
index 1f33274d3..ed655bb31 100644
--- a/config/breadcrumbs.rb
+++ b/config/breadcrumbs.rb
@@ -136,9 +136,14 @@ crumb :routing_constraint_zone do |referential, line, routing_constraint_zone|
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
+crumb :route do |referential, route|
+ link I18n.t('routes.index.title', route: route.name), referential_line_route_path(referential, route.line, route)
+ parent :referential_line, referential, route.line
+end
+
+crumb :journey_patterns do |referential, route|
+ link I18n.t('journey_patterns.index.title'), referential_line_route_journey_patterns_collection_path(referential, route.line, route)
+ parent :route, referential, route
end
# crumb :compliance_controls do|compliance_control_sets|