aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/referential_lines/show.html.slim
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/referential_lines/show.html.slim')
-rw-r--r--app/views/referential_lines/show.html.slim22
1 files changed, 13 insertions, 9 deletions
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index ae8314a14..495f0bda7 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -121,15 +121,19 @@ h3.routes = t('.itineraries')
- content_for :sidebar do
ul.actions
- li
- = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add'
- li
- = link_to t('lines.actions.edit'), edit_referential_line_path(@referential, @line), class: 'edit'
- li
- = link_to t('lines.actions.destroy'), referential_line_path(@referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove'
+ - if policy(Chouette::Line).create?
+ li
+ = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add'
+ - if policy(@line).update?
+ li
+ = link_to t('lines.actions.edit'), edit_referential_line_path(@referential, @line), class: 'edit'
+ - if policy(@line).destroy?
+ li
+ = link_to t('lines.actions.destroy'), referential_line_path(@referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove'
- if !@line.hub_restricted? || (@line.hub_restricted? && @line.routes.size < 2)
- li
- = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add'
+ / FIXME #825
+ li
+ / = link_to t('routes.actions.new'), new_referential_line_route_path(@referential, @line), class: 'add'
- = creation_tag(@line) \ No newline at end of file
+ = creation_tag(@line)