2014-03-17 16:36:32 +01:00
|
|
|
.row
|
|
|
|
|
.col-md-12
|
2014-11-14 11:58:36 +01:00
|
|
|
.page-header
|
2017-01-10 17:07:28 +02:00
|
|
|
%h1
|
2014-11-14 11:58:36 +01:00
|
|
|
Users
|
|
|
|
|
- if @users
|
|
|
|
|
= "(#{@users.length})"
|
2017-01-10 17:07:28 +02:00
|
|
|
- if can? :create, User
|
|
|
|
|
.pull-right
|
2017-05-11 11:59:33 +02:00
|
|
|
= link_to 'Add User', new_admin_user_path, :class => 'button btn btn-default btn-info'
|
2014-11-14 11:58:36 +01:00
|
|
|
.row
|
2016-03-07 15:15:29 +05:30
|
|
|
.col-md-12.table-responsive
|
2014-11-14 11:58:36 +01:00
|
|
|
%table.table.table-striped.table-bordered.table-hover.datatable
|
2014-08-22 15:08:54 +02:00
|
|
|
%thead
|
|
|
|
|
%th ID
|
2016-07-11 04:41:25 -04:00
|
|
|
%th Confirmed?
|
2014-08-22 15:08:54 +02:00
|
|
|
%th Email
|
|
|
|
|
%th Name
|
|
|
|
|
%th Attended Conferences
|
|
|
|
|
%th Roles
|
|
|
|
|
%th View
|
|
|
|
|
%th Edit
|
|
|
|
|
%tbody
|
2014-03-17 16:36:32 +01:00
|
|
|
- @users.each do |user|
|
|
|
|
|
%tr
|
|
|
|
|
%td
|
|
|
|
|
= user.id
|
2017-03-03 12:36:42 +02:00
|
|
|
%td{ 'data-order' => "#{user.confirmed?}" }
|
2016-07-11 04:41:25 -04:00
|
|
|
- if can? :toggle_confirmation, user
|
|
|
|
|
= check_box_tag user.id, user.id, user.confirmed?,
|
|
|
|
|
method: :patch,
|
|
|
|
|
url: "/admin/users/#{user.id}/toggle_confirmation?user[to_confirm]=",
|
|
|
|
|
class: 'switch-checkbox',
|
|
|
|
|
readonly: false,
|
|
|
|
|
data: { size: 'small', on_color: 'success', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
2014-03-17 16:36:32 +01:00
|
|
|
- else
|
2016-07-11 04:41:25 -04:00
|
|
|
= check_box_tag user.id, user.id, user.confirmed?,
|
|
|
|
|
method: :patch,
|
|
|
|
|
url: "/admin/users/#{user.id}/toggle_confirmation?user[to_confirm]=",
|
|
|
|
|
class: 'switch-checkbox',
|
|
|
|
|
readonly: true,
|
|
|
|
|
data: { size: 'small', on_color: 'success', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
2014-03-17 16:36:32 +01:00
|
|
|
%td
|
|
|
|
|
= user.email
|
|
|
|
|
%td
|
2014-06-23 19:07:50 +03:00
|
|
|
= user.name
|
2014-03-17 16:36:32 +01:00
|
|
|
%td
|
2014-08-12 11:51:59 +03:00
|
|
|
= user.registrations.where(attended: true).count
|
2014-03-17 16:36:32 +01:00
|
|
|
%td
|
2014-08-13 14:37:15 +03:00
|
|
|
- unless user.get_roles.blank?
|
|
|
|
|
= show_roles(user.get_roles.first(2))
|
|
|
|
|
- if user.get_roles.count > 2
|
2014-08-12 11:51:59 +03:00
|
|
|
= '...'
|
2014-08-22 15:08:54 +02:00
|
|
|
- else
|
|
|
|
|
None
|
2016-05-01 18:50:07 +03:00
|
|
|
%td
|
|
|
|
|
- if can? :show, user
|
2014-08-22 15:08:54 +02:00
|
|
|
= link_to 'View', admin_user_path(user), class: 'btn btn-success'
|
2016-05-01 18:50:07 +03:00
|
|
|
%td
|
|
|
|
|
- if can? :update, user
|
2014-08-22 15:08:54 +02:00
|
|
|
= link_to 'Edit', edit_admin_user_path(user), class: 'btn btn-primary'
|