diff options
| author | jpl | 2017-03-22 11:17:45 +0100 |
|---|---|---|
| committer | jpl | 2017-03-22 11:17:45 +0100 |
| commit | 5445d5ae221837d5a91843a758df69fcfdb899f7 (patch) | |
| tree | 60d8af4691c8bb57501ae4e13c2faf916abca58e | |
| parent | 87e2ed2375a5fdfc85f42a632cff48168ac22af7 (diff) | |
| download | chouette-core-5445d5ae221837d5a91843a758df69fcfdb899f7.tar.bz2 | |
Refs #2901: updating referential#show according to policies
| -rw-r--r-- | app/views/referentials/show.html.slim | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index f12f47aa4..62a17ea1e 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -9,18 +9,21 @@ .row.mb-sm .col-lg-12.text-right / Actions are: controler, rapport de controle, dupliquer, purger, conserver, supprimer - = link_to t('actions.clone'), new_referential_path(from: @referential.id), class: 'btn btn-primary' + - if policy(@referential).new? + = link_to t('actions.clone'), new_referential_path(from: @referential.id), class: 'btn btn-primary' - button.btn.btn-primary type='button' data-toggle='modal' data-target='#purgeModal' Purger + - if policy(@referential).edit? + button.btn.btn-primary type='button' data-toggle='modal' data-target='#purgeModal' Purger - - if @referential.archived? - = link_to t('actions.unarchive'), unarchive_referential_path(@referential.id), method: :put, class: 'btn btn-primary' - - else - = link_to t('actions.archive'), archive_referential_path(@referential.id), method: :put, class: 'btn btn-primary' + - if @referential.archived? + = link_to t('actions.unarchive'), unarchive_referential_path(@referential.id), method: :put, class: 'btn btn-primary' + - else + = link_to t('actions.archive'), archive_referential_path(@referential.id), method: :put, class: 'btn btn-primary' - = link_to referential_path(@referential), method: :delete, data: {confirm: t('referentials.actions.destroy_confirm')}, class: 'btn btn-primary' do - span.fa.fa-trash - span = t('actions.destroy') + - if policy(@referential).destroy? + = link_to referential_path(@referential), method: :delete, data: {confirm: t('referentials.actions.destroy_confirm')}, class: 'btn btn-primary' do + span.fa.fa-trash + span = t('actions.destroy') / PageContent .page_content |
