diff options
| author | Xinhui | 2016-10-10 11:25:10 +0200 |
|---|---|---|
| committer | Xinhui | 2016-10-10 11:25:10 +0200 |
| commit | 1cd01cc22e45710adf2efa080662d919daaaeed3 (patch) | |
| tree | dfa168b12c5306141f47bed40ecfc501694a4ecf /app/views | |
| parent | fc25c675b21524d722f3e0e2ae34db43392f1651 (diff) | |
| download | chouette-core-1cd01cc22e45710adf2efa080662d919daaaeed3.tar.bz2 | |
GroupOfLine policy
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/group_of_lines/show.html.slim | 23 | ||||
| -rw-r--r-- | app/views/lines/show.html.slim | 4 |
2 files changed, 15 insertions, 12 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) diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index af9a72b15..cca0e395c 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -134,10 +134,10 @@ h3.routes = t('.itineraries') - if policy(Chouette::Line).create? li = link_to t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'add' - - if policy(Chouette::Line).update? + - if policy(@line).update? li = link_to t('lines.actions.edit'), edit_line_referential_line_path(@line_referential, @line), class: 'edit' - - if policy(Chouette::Line).destroy? + - if policy(@line).destroy? li = link_to t('lines.actions.destroy'), line_referential_line_path(@line_referential, @line), method: :delete, :data => {:confirm => t('lines.actions.destroy_confirm')}, class: 'remove' |
