From 8d3c6568b57d7a7b15b7e4a507d85e5d498324f4 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Sat, 13 Dec 2014 21:59:19 +0200 Subject: [PATCH 1/2] fix users list actions --- app/views/admin/users/index.html.haml | 31 ++++++++++++--------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 17d25df2..80769f5f 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -16,9 +16,7 @@ %th Name %th Attended Conferences %th Roles - %th View - %th Edit - %th Delete + %th Actions %tbody - @users.each do |user| %tr @@ -42,17 +40,16 @@ = '...' - else None - - if can? :show, user - %td - = link_to 'View', admin_user_path(user), class: 'btn btn-success' - - if can? :update, user - %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' \ No newline at end of file + %td{width: '170px'} + .btn-group + - if can? :show, user + = link_to 'View', admin_user_path(user), class: 'btn btn-success' + - if can? :update, user + = link_to 'Edit', edit_admin_user_path(user), class: 'btn btn-primary' + - if can? :destroy, user + - if current_user.id == user.id + = 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' From 06bda7a7db00b09be53cb45f05cf50fb6ebf0fd7 Mon Sep 17 00:00:00 2001 From: Stella Date: Fri, 19 Dec 2014 13:11:11 +0200 Subject: [PATCH 2/2] add style in osem.css --- app/assets/stylesheets/osem.css.scss | 6 +++++- app/views/admin/users/index.html.haml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.css.scss index 302e13ee..08e68b87 100644 --- a/app/assets/stylesheets/osem.css.scss +++ b/app/assets/stylesheets/osem.css.scss @@ -53,4 +53,8 @@ body { fieldset { margin: 20px 0 20px 0; -} \ No newline at end of file +} + +.col-actions { + width: 170px; +} diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 80769f5f..b8210fcc 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -40,7 +40,7 @@ = '...' - else None - %td{width: '170px'} + %td.col-actions .btn-group - if can? :show, user = link_to 'View', admin_user_path(user), class: 'btn btn-success'