diff options
| author | cedricnjanga | 2017-09-13 15:39:34 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-09-13 15:39:50 +0200 |
| commit | 4804a4886c5267c1be1c367caaf35c17c681d179 (patch) | |
| tree | 5e89dd1143e393cc99f2c9ffcc0e346f6c1e5120 | |
| parent | 2c8bf4bec7229241aee1fb8f304cf080fc403fb7 (diff) | |
| download | chouette-core-4804a4886c5267c1be1c367caaf35c17c681d179.tar.bz2 | |
Apply object id changes to views
| -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( \ |
