aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/routes_controller.rb6
-rw-r--r--app/decorators/route_decorator.rb (renamed from app/decorators/chouette/route_decorator.rb)4
-rw-r--r--app/views/routes/show.html.slim17
3 files changed, 15 insertions, 12 deletions
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index 73febc4b9..786bd57cc 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -42,6 +42,12 @@ class RoutesController < ChouetteController
end
show! do
+ @route = @route.decorate(context: {
+ referential: @referential,
+ line: @line,
+ route_sp: @route_sp
+ })
+
build_breadcrumb :show
end
end
diff --git a/app/decorators/chouette/route_decorator.rb b/app/decorators/route_decorator.rb
index f98fbfcb1..99b174dff 100644
--- a/app/decorators/chouette/route_decorator.rb
+++ b/app/decorators/route_decorator.rb
@@ -1,4 +1,6 @@
-class Chouette::RouteDecorator < Draper::Decorator
+class RouteDecorator < Draper::Decorator
+ decorates Chouette::Route
+
delegate_all
# Requires:
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 6d2d4e90d..92a5080ae 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -8,17 +8,12 @@
/ Below is secundary actions & optional contents (filters, ...)
.row.mb-sm
.col-lg-12.text-right
- - if @route_sp.any?
- = link_to t('journey_patterns.index.title'), [@referential, @line, @route, :journey_patterns_collection], class: 'btn btn-primary'
- - if @route.journey_patterns.present?
- = link_to t('vehicle_journeys.actions.index'), [@referential, @line, @route, :vehicle_journeys], class: 'btn btn-primary'
-
- = link_to t('vehicle_journey_exports.new.title'), referential_line_route_vehicle_journey_exports_path(@referential, @line, @route, format: :zip), class: 'btn btn-primary'
-
- - if policy(@route).destroy?
- = link_to referential_line_route_path(@referential, @line, @route), method: :delete, data: {confirm: t('routes.actions.destroy_confirm')}, class: 'btn btn-primary' do
- span.fa.fa-trash
- span = t('actions.destroy')
+ - @route.action_links.each do |link|
+ = link_to link.href,
+ method: link.method,
+ data: link.data,
+ class: 'btn btn-primary' do
+ = link.content
/ PageContent
.page_content