aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/group_of_lines
diff options
context:
space:
mode:
authorXinhui2016-10-10 11:25:10 +0200
committerXinhui2016-10-10 11:25:10 +0200
commit1cd01cc22e45710adf2efa080662d919daaaeed3 (patch)
treedfa168b12c5306141f47bed40ecfc501694a4ecf /app/views/group_of_lines
parentfc25c675b21524d722f3e0e2ae34db43392f1651 (diff)
downloadchouette-core-1cd01cc22e45710adf2efa080662d919daaaeed3.tar.bz2
GroupOfLine policy
Diffstat (limited to 'app/views/group_of_lines')
-rw-r--r--app/views/group_of_lines/show.html.slim23
1 files changed, 13 insertions, 10 deletions
diff --git a/app/views/group_of_lines/show.html.slim b/app/views/group_of_lines/show.html.slim
index c93f5277e..b934cb1ef 100644
--- a/app/views/group_of_lines/show.html.slim
+++ b/app/views/group_of_lines/show.html.slim
@@ -2,7 +2,7 @@
.group_of_line_show
= @map.to_html
-
+
.summary
p
label = "#{@group_of_line.human_attribute_name('registration_number')} : "
@@ -13,19 +13,22 @@
= @group_of_line.comment
p.after_map
-
+
h3.group_of_line_lines = t('.lines')
.lines_detail
- == render partial: "lines_detail"
+ == render partial: "lines_detail"
- content_for :sidebar do
ul.actions
- li
- = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add'
- li
- = link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), class: 'edit'
- li
- = link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove'
+ - if policy(Chouette::GroupOfLine).create?
+ li
+ = link_to t('group_of_lines.actions.new'), new_line_referential_group_of_line_path(@line_referential), class: 'add'
+ - if policy(@group_of_line).edit?
+ li
+ = link_to t('group_of_lines.actions.edit'), edit_line_referential_group_of_line_path(@line_referential, @group_of_line), class: 'edit'
+ - if policy(@group_of_line).destroy?
+ li
+ = link_to t('group_of_lines.actions.destroy'), line_referential_group_of_line_path(@line_referential, @group_of_line), :method => :delete, :data => {:confirm => t('group_of_lines.actions.destroy_confirm')} , class: 'remove'
br
- = creation_tag(@group_of_line) \ No newline at end of file
+ = creation_tag(@group_of_line)