diff options
| -rw-r--r-- | app/views/referentials/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/referentials/show.js.slim | 19 |
2 files changed, 1 insertions, 21 deletions
diff --git a/app/views/referentials/show.html.slim b/app/views/referentials/show.html.slim index 9ed63d516..e50872b0e 100644 --- a/app/views/referentials/show.html.slim +++ b/app/views/referentials/show.html.slim @@ -3,12 +3,11 @@ @referential.name, 'Lorem ipsum dolor sit amet', t('last_update', time: l(@referential.updated_at, format: :short)), - @referential.archived? ? nil : link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default') do + ((@referential.archived? || !policy(@referential).edit?) ? '' : link_to(t('actions.edit'), edit_referential_path(@referential), class: 'btn btn-default')) do / Below is secundary actions & optional contents (filters, ...) .row.mb-sm .col-lg-12.text-right - / Actions are: controler, rapport de controle, dupliquer, purger, conserver, supprimer - if policy(@referential).new? = link_to t('actions.clone'), new_referential_path(from: @referential.id), class: 'btn btn-primary' diff --git a/app/views/referentials/show.js.slim b/app/views/referentials/show.js.slim deleted file mode 100644 index 5e47bf935..000000000 --- a/app/views/referentials/show.js.slim +++ /dev/null @@ -1,19 +0,0 @@ -| $(function() { -| var ref, update_infos, update_referential_details, _i, _len, _ref, _results; -| update_infos = function(json) { -| var info, update_info; -| info = $('#referential_' + json.referential_id); -| update_info = function(key, value) { -| if (key.match(/_count$/)) { -| return $(info.find('.' + key)[0]).text(value); -| } -| }; -| return $.each(json, update_info); -| }; -| update_referential_details = function() { -| return $.getJSON("#{referential_path(@referential, format: :json)}", update_infos); -| }; -| _results = []; -| _results.push(update_referential_details()); -| return _results; -| }); |
