aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/referential_lines_controller.rb8
-rw-r--r--app/views/referential_lines/show.html.slim21
2 files changed, 14 insertions, 15 deletions
diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb
index fe81bee12..1da64991d 100644
--- a/app/controllers/referential_lines_controller.rb
+++ b/app/controllers/referential_lines_controller.rb
@@ -37,6 +37,14 @@ class ReferentialLinesController < ChouetteController
)
show! do
+ @line = ReferentialLineDecorator.decorate(
+ @line,
+ context: {
+ referential: referential,
+ current_organisation: current_organisation
+ }
+ )
+
build_breadcrumb :show
end
end
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 14e300aa2..34c296932 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -7,21 +7,12 @@
/ Below is secundary actions & optional contents
.row
.col-lg-12.text-right.mb-sm
- = link_to @line.human_attribute_name(:footnotes), referential_line_footnotes_path(@referential, @line), class: 'btn btn-primary'
- = link_to t('routing_constraint_zones.index.title'), referential_line_routing_constraint_zones_path(@referential, @line), class: 'btn btn-primary'
-
- - if policy(Chouette::Line).create? && @referential.organisation == current_organisation
- = link_to t('actions.new'), new_referential_line_path(@referential), class: 'btn btn-primary'
- - if policy(@line).update?
- = link_to t('actions.edit'), edit_referential_line_path(@referential, @line), class: 'btn btn-primary'
- - if policy(@line).destroy?
- = link_to referential_line_path(@referential, @line), method: :delete, data: {confirm: t('lines.actions.destroy_confirm')}, class: 'btn btn-primary' do
- span.fa.fa-trash
- span = t('actions.destroy')
-
- - if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2)
- - if policy(Chouette::Route).create? && @referential.organisation == current_organisation
- = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'btn btn-primary'
+ - @line.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