diff options
| author | Xinhui | 2017-10-20 15:02:35 +0200 | 
|---|---|---|
| committer | Xinhui | 2017-10-20 15:05:08 +0200 | 
| commit | fccf690adb8769dc5050fa231a961b5e48146848 (patch) | |
| tree | ce125832d5e75e5bf30c21cc13f9fd1a78bc082d | |
| parent | bdeb36005106c099ee3fa831604082ef9df2f27c (diff) | |
| download | chouette-core-fccf690adb8769dc5050fa231a961b5e48146848.tar.bz2 | |
Breadcrumb for journey_patterns
| -rw-r--r-- | app/controllers/journey_patterns_collections_controller.rb | 1 | ||||
| -rw-r--r-- | app/policies/route_policy.rb | 1 | ||||
| -rw-r--r-- | app/views/journey_patterns_collections/show.html.slim | 5 | ||||
| -rw-r--r-- | app/views/routes/edit.html.slim | 2 | ||||
| -rw-r--r-- | app/views/routes/show.html.slim | 2 | ||||
| -rw-r--r-- | config/breadcrumbs.rb | 11 | 
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| | 
