HACK! Show confirmed status in the all users export

This commit is contained in:
Michael Ball 2021-03-08 19:24:34 -08:00
parent e311a65f02
commit 676d10ce36
3 changed files with 15 additions and 1 deletions

View file

@ -66,6 +66,12 @@ module Admin
def edit; end
def delete
@user.destroy!
flash[:notice] = "User #{@user.id} (#{@user.emai}) successfully deleted."
redirect_to admin_users_path
end
private
def user_params

View file

@ -35,7 +35,8 @@ class UserDatatable < AjaxDatatablesRails::Base
roles: record.roles.any? ? show_roles(record.get_roles) : 'None',
view_url: 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

View file

@ -20,6 +20,7 @@
%th{ width: '0' } Conferences Attended
%th{ width: '50%' } Roles
%th{ width: '0' } Actions
%th{ style: 'display: none' } Confirmed?
%tbody
:javascript
@ -37,6 +38,7 @@
{
"data": "confirmed_at",
"render": function (data, type, row, meta) {
console.log(meta)
return '<input type="checkbox" class="switch-checkbox" '+
'id="user_'+row.id+'_confirmed" '+
'name="user_'+row.id+'_confirmed" '+
@ -73,6 +75,11 @@
'<a class="btn-primary" href="'+data.edit_url+'">Edit</a>'+
'</div>';
}
},
{
"data": "confirmed",
"className": 'sr-only',
"render": false
}
]
});