diff --git a/app/controllers/admin/registrations_controller.rb b/app/controllers/admin/registrations_controller.rb index 0fa8a8af..88027bbd 100644 --- a/app/controllers/admin/registrations_controller.rb +++ b/app/controllers/admin/registrations_controller.rb @@ -20,7 +20,7 @@ module Admin respond_to do |format| format.html format.json do - render json: RegistrationDatatable.new({}, conference: @conference, view_context: view_context) + render json: RegistrationDatatable.new(params, conference: @conference, view_context: view_context) end format.pdf { render 'index', layout: false } format.xlsx do diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index b980540c..9820cef1 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -23,7 +23,7 @@ module Admin respond_to do |format| format.html format.json do - render json: UserDatatable.new({}, view_context: view_context) + render json: UserDatatable.new(params, view_context: view_context) end end end diff --git a/app/datatables/registration_datatable.rb b/app/datatables/registration_datatable.rb index 7384933c..965aa822 100644 --- a/app/datatables/registration_datatable.rb +++ b/app/datatables/registration_datatable.rb @@ -14,7 +14,6 @@ class RegistrationDatatable < AjaxDatatablesRails::ActiveRecord @view_columns ||= { id: { source: 'Registration.id', cond: :eq }, name: { source: 'User.name' }, - roles: { source: 'Role.name' }, email: { source: 'User.email' }, accepted_code_of_conduct: { source: 'Registration.accepted_code_of_conduct', searchable: false }, actions: { source: 'Registration.id', searchable: false, orderable: false } @@ -41,7 +40,6 @@ class RegistrationDatatable < AjaxDatatablesRails::ActiveRecord roles: conference_role_titles(record.user), email: record.email, accepted_code_of_conduct: !!record.accepted_code_of_conduct, # rubocop:disable Style/DoubleNegation - questions: {}, edit_url: edit_admin_conference_registration_path(conference, record), DT_RowId: record.id } @@ -53,7 +51,7 @@ class RegistrationDatatable < AjaxDatatablesRails::ActiveRecord end # override upstream santitation, which converts everything to strings - def sanitize(records) + def sanitize_data(records) records end end diff --git a/app/datatables/user_datatable.rb b/app/datatables/user_datatable.rb index b21f6fea..d7e102d2 100644 --- a/app/datatables/user_datatable.rb +++ b/app/datatables/user_datatable.rb @@ -22,8 +22,7 @@ class UserDatatable < AjaxDatatablesRails::ActiveRecord name: { source: 'User.name' }, attended: { source: 'attended_count', searchable: false }, roles: { source: 'Role.name' }, - view_url: { source: 'User.id', searchable: false, orderable: false }, - edit_url: { source: 'User.id', searchable: false, orderable: false } + actions: { source: 'User.id', searchable: false, orderable: false } } end diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index 09f674e9..512899a2 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -26,7 +26,6 @@ %tr %th{ width: '0' } ID# %th{ width: '25%' } Name - %th{ width: '0' } Roles %th{ width: '0' } E-Mail %th{ width: '0' } %abbr{ title: 'Code of Conduct' } CoC @@ -63,14 +62,6 @@ return content; } }, - { - "name": "roles", - "data": "roles", - "className": "truncate", - "render": function(data, type, row) { - return data.join(', '); - } - }, { "data": "email" }, @@ -80,13 +71,13 @@ "searchable": false }, { - "data": null, + "data": "actions", "className": "actions", "searchable": false, "sortable": false, "render": function (data, type, row, meta) { return '
'+ - 'Edit'+ + 'Edit'+ '
'; } } @@ -94,5 +85,4 @@ }); registrationsDataTable.columns(3).visible(codeOfConductPresent); - registrationsDataTable.columns(2).visible(false); }); diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index e2b47504..2fb1c72a 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -61,13 +61,13 @@ } }, { - "data": null, + "data": "actions", "className": "actions", "sortable": false, "render": function (data, type, row, meta) { return '
'+ - 'View'+ - 'Edit'+ + 'View'+ + 'Edit'+ '
'; } }