HACK! Show confirmed status in the all users export
This commit is contained in:
parent
e311a65f02
commit
676d10ce36
3 changed files with 15 additions and 1 deletions
|
|
@ -66,6 +66,12 @@ module Admin
|
||||||
|
|
||||||
def edit; end
|
def edit; end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
@user.destroy!
|
||||||
|
flash[:notice] = "User #{@user.id} (#{@user.emai}) successfully deleted."
|
||||||
|
redirect_to admin_users_path
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def user_params
|
def user_params
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ class UserDatatable < AjaxDatatablesRails::Base
|
||||||
roles: record.roles.any? ? show_roles(record.get_roles) : 'None',
|
roles: record.roles.any? ? show_roles(record.get_roles) : 'None',
|
||||||
view_url: admin_user_path(record),
|
view_url: admin_user_path(record),
|
||||||
edit_url: edit_admin_user_path(record),
|
edit_url: edit_admin_user_path(record),
|
||||||
DT_RowId: record.id
|
DT_RowId: record.id,
|
||||||
|
confirmed: record.confirmed_at.present?
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
%th{ width: '0' } Conferences Attended
|
%th{ width: '0' } Conferences Attended
|
||||||
%th{ width: '50%' } Roles
|
%th{ width: '50%' } Roles
|
||||||
%th{ width: '0' } Actions
|
%th{ width: '0' } Actions
|
||||||
|
%th{ style: 'display: none' } Confirmed?
|
||||||
%tbody
|
%tbody
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
|
|
@ -37,6 +38,7 @@
|
||||||
{
|
{
|
||||||
"data": "confirmed_at",
|
"data": "confirmed_at",
|
||||||
"render": function (data, type, row, meta) {
|
"render": function (data, type, row, meta) {
|
||||||
|
console.log(meta)
|
||||||
return '<input type="checkbox" class="switch-checkbox" '+
|
return '<input type="checkbox" class="switch-checkbox" '+
|
||||||
'id="user_'+row.id+'_confirmed" '+
|
'id="user_'+row.id+'_confirmed" '+
|
||||||
'name="user_'+row.id+'_confirmed" '+
|
'name="user_'+row.id+'_confirmed" '+
|
||||||
|
|
@ -73,6 +75,11 @@
|
||||||
'<a class="btn-primary" href="'+data.edit_url+'">Edit</a>'+
|
'<a class="btn-primary" href="'+data.edit_url+'">Edit</a>'+
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": "confirmed",
|
||||||
|
"className": 'sr-only',
|
||||||
|
"render": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue