diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index f8cabef6..65ec886e 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -52,11 +52,9 @@ %td = link_to "Edit", edit_admin_user_path(user), class: 'btn btn-primary' - if can? :destroy, user - %td - - if current_user.id == user.id or user.role_ids.include? 3 - =link_to 'Delete',admin_user_path(user), :method => :delete , :data => {:confirm => 'Are you sure ?'}, :disabled => true,:class => "btn btn-primary disabled btn-danger",:role => "button" - - else - =link_to 'Delete',admin_user_path(user), :method=> :delete , :data=> {:confirm => 'Are you sure ?'},:class => "btn btn-primary btn-danger" + %td= link_to 'Delete',admin_user_path(user), :method=> :delete , :data=> {:confirm => 'Are you sure ?'},:class => "btn btn-primary btn-danger" + - else + %td= link_to 'Delete',admin_user_path(user), :method => :delete , :data => {:confirm => 'Are you sure ?'}, :disabled => true,:class => "btn btn-primary disabled btn-danger",:role => "button" :javascript diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 56aaa5a7..9ad4c8ab 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -1,3 +1,6 @@ +- if can? :update, @user + .pull-right + = link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary' %table.table - @show_attributes.each do |attr| %tr