2014-03-17 16:36:32 +01:00
|
|
|
.row
|
|
|
|
|
.col-md-12
|
|
|
|
|
%h2
|
|
|
|
|
Users
|
|
|
|
|
- if @users
|
|
|
|
|
= "(#{@users.length})"
|
2014-06-23 19:07:50 +03:00
|
|
|
|
2014-08-12 11:51:59 +03:00
|
|
|
= link_to "New User", new_admin_user_path, class: 'btn btn-success pull-right'
|
2014-03-17 16:36:32 +01:00
|
|
|
.well
|
|
|
|
|
%table.table.table-striped.table-bordered.table-hover#users
|
|
|
|
|
%thead
|
|
|
|
|
%th
|
|
|
|
|
%b ID
|
|
|
|
|
%th
|
|
|
|
|
%b State
|
|
|
|
|
%th
|
|
|
|
|
%b Email
|
|
|
|
|
%th
|
2014-06-23 19:07:50 +03:00
|
|
|
%b Name
|
2014-03-17 16:36:32 +01:00
|
|
|
%th
|
2014-08-12 11:51:59 +03:00
|
|
|
%b Attended Conferences
|
2014-03-17 16:36:32 +01:00
|
|
|
%th
|
|
|
|
|
%b Roles
|
|
|
|
|
%th
|
|
|
|
|
%th
|
2014-03-27 20:14:52 +05:30
|
|
|
%th
|
2014-03-17 16:36:32 +01:00
|
|
|
- @users.each do |user|
|
|
|
|
|
%tr
|
|
|
|
|
%td
|
|
|
|
|
= user.id
|
|
|
|
|
%td
|
|
|
|
|
- if user.confirmed?
|
|
|
|
|
confirmed
|
|
|
|
|
- else
|
|
|
|
|
unconfirmed
|
|
|
|
|
%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
|
|
|
= '...'
|
|
|
|
|
- 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"
|
2014-03-27 20:14:52 +05:30
|
|
|
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2013-05-07 14:46:33 +02:00
|
|
|
:javascript
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
$('#users').dataTable( {
|
2013-06-14 13:17:40 +02:00
|
|
|
"bPaginate": false,
|
|
|
|
|
"bLengthChange": false
|
2013-05-07 14:46:33 +02:00
|
|
|
} );
|
|
|
|
|
} );
|