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
|
2018-06-18 10:04:17 -07:00
|
|
|
%table.datatable#users{ data: { source: admin_users_path(format: :json) } }
|
2014-08-22 15:08:54 +02:00
|
|
|
%thead
|
2023-03-04 13:12:47 -08:00
|
|
|
%tr
|
|
|
|
|
%th{ width: '0' } ID
|
|
|
|
|
%th{ width: '0' } Confirmed?
|
|
|
|
|
%th{ width: '0' } Email
|
|
|
|
|
%th{ width: '50%' } Name
|
|
|
|
|
%th{ width: '0' } Conferences Attended
|
|
|
|
|
%th{ width: '50%' } Roles
|
|
|
|
|
%th{ width: '0' } Actions
|
2014-08-22 15:08:54 +02:00
|
|
|
%tbody
|
2018-06-18 10:04:17 -07:00
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
|
$(function () {
|
|
|
|
|
$('#users.datatable').DataTable({
|
|
|
|
|
"processing": true,
|
|
|
|
|
"serverSide": true,
|
|
|
|
|
"ajax": $('#users.datatable').data('source'),
|
|
|
|
|
"drawCallback": function(settings) {
|
|
|
|
|
checkboxSwitch("[class='switch-checkbox']");
|
|
|
|
|
},
|
|
|
|
|
"columns": [
|
|
|
|
|
{ "data": "id" },
|
|
|
|
|
{
|
|
|
|
|
"data": "confirmed_at",
|
|
|
|
|
"render": function (data, type, row, meta) {
|
|
|
|
|
return '<input type="checkbox" class="switch-checkbox" '+
|
|
|
|
|
'id="user_'+row.id+'_confirmed" '+
|
|
|
|
|
'name="user_'+row.id+'_confirmed" '+
|
|
|
|
|
(row.confirmed_at === '' ? '' : 'checked="checked" ')+
|
|
|
|
|
'url="/admin/users/'+row.id+'/toggle_confirmation?user[to_confirm]=" '+
|
|
|
|
|
'/>'
|
|
|
|
|
},
|
|
|
|
|
"searchable": false
|
|
|
|
|
},
|
|
|
|
|
{ "data": "email" },
|
|
|
|
|
{
|
|
|
|
|
"data": "name",
|
|
|
|
|
"className": "truncate",
|
|
|
|
|
"render": function (data, type, row, meta) {
|
|
|
|
|
return '<span data-toggle="tooltip" title="'+data+'">'+data+'</span>'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ "data": "attended" },
|
|
|
|
|
{
|
|
|
|
|
"data": "roles",
|
|
|
|
|
"className": "truncate" ,
|
|
|
|
|
"render": function (data, type, row, meta) {
|
|
|
|
|
return '<span data-toggle="tooltip" title="'+data+'">'+data+'</span>'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-03-18 08:46:52 -07:00
|
|
|
"data": "actions",
|
2018-06-18 10:04:17 -07:00
|
|
|
"className": "actions",
|
|
|
|
|
"sortable": false,
|
|
|
|
|
"render": function (data, type, row, meta) {
|
|
|
|
|
return '<div class="btn-group">'+
|
2022-03-18 08:46:52 -07:00
|
|
|
'<a class="btn-info" href="'+row.view_url+'">View</a>'+
|
|
|
|
|
'<a class="btn-primary" href="'+row.edit_url+'">Edit</a>'+
|
2018-06-18 10:04:17 -07:00
|
|
|
'</div>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
});
|