diff options
| -rw-r--r-- | app/controllers/referential_lines_controller.rb | 2 | ||||
| -rw-r--r-- | app/decorators/route_decorator.rb | 18 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/routes/show.html.slim | 4 | ||||
| -rw-r--r-- | app/views/time_tables/index.html.slim | 2 | 
5 files changed, 14 insertions, 14 deletions
| diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index 1da64991d..ec0bbbb18 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -11,7 +11,7 @@ class ReferentialLinesController < ChouetteController    belongs_to :referential    def show -    @routes = resource.routes +    @routes = resource.routes.order(:objectid)      case sort_route_column      when "stop_points", "journey_patterns" diff --git a/app/decorators/route_decorator.rb b/app/decorators/route_decorator.rb index 46cb6cd5f..510c941a3 100644 --- a/app/decorators/route_decorator.rb +++ b/app/decorators/route_decorator.rb @@ -45,28 +45,28 @@ class RouteDecorator < Draper::Decorator        )      ) -    if h.policy(object).destroy? +    if h.policy(object).duplicate?        links << Link.new( -        content: h.destroy_link_content, -        href: h.referential_line_route_path( +        content: h.t('routes.duplicate.title'), +        href: h.duplicate_referential_line_route_path(            context[:referential],            context[:line],            object          ), -        method: :delete, -        data: { confirm: h.t('routes.actions.destroy_confirm') } +        method: :post        )      end -    if h.policy(object).duplicate? +    if h.policy(object).destroy?        links << Link.new( -        content: h.t('routes.duplicate.title'), -        href: h.duplicate_referential_line_route_path( +        content: h.destroy_link_content, +        href: h.referential_line_route_path(            context[:referential],            context[:line],            object          ), -        method: :post +        method: :delete, +        data: { confirm: h.t('routes.actions.destroy_confirm') }        )      end diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index cbce7a7d5..6e59d83b3 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -46,7 +46,7 @@                  [ \                    TableBuilderHelper::Column.new( \                      name: 'ID', \ -                    attribute: Proc.new { |n| n.objectid.local_id }, \ +                    attribute: Proc.new { |n| n.objectid.short_id }, \                      sortable: false \                    ), \                    TableBuilderHelper::Column.new( \ diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim index a21b5ec8a..e2681d215 100644 --- a/app/views/routes/show.html.slim +++ b/app/views/routes/show.html.slim @@ -21,7 +21,7 @@      .row        .col-lg-6.col-md-6.col-sm-12.col-xs-12          = definition_list t('metadatas'), -          { t('id_codif') => @route.try(:objectid).try(:local_id), +          { t('objectid') => @route.objectid.short_id,              t('activerecord.attributes.route.published_name') => (@route.published_name ? @route.published_name : '-'),              @route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ),              @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') } @@ -29,7 +29,7 @@        - if @route_sp.any?          .col-lg-6.col-md-6.col-sm-12.col-xs-12            #route_map.map.mb-lg -       +      .row        .col-lg-12          - if @route_sp.any? diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim index 2390c2df0..b984f95c8 100644 --- a/app/views/time_tables/index.html.slim +++ b/app/views/time_tables/index.html.slim @@ -18,7 +18,7 @@              [ \                TableBuilderHelper::Column.new( \                  name: 'ID', \ -                attribute: Proc.new { |n| n.objectid.local_id }, \ +                attribute: Proc.new { |n| n.objectid.short_id}, \                  sortable: false \                ), \                TableBuilderHelper::Column.new( \ | 
