2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-11-04 10:40:00 +01:00
|
|
|
module Manager
|
|
|
|
class TeamAccountsController < Manager::ApplicationController
|
|
|
|
def index
|
|
|
|
@records_per_page = params[:records_per_page] || "10"
|
2022-11-24 14:33:32 +01:00
|
|
|
|
|
|
|
resources = Administrateur
|
|
|
|
.where(user: { team_account: true })
|
2022-11-04 10:40:00 +01:00
|
|
|
.order(created_at: :asc)
|
|
|
|
.page(params[:_page])
|
|
|
|
.per(@records_per_page)
|
2022-11-24 14:21:32 +01:00
|
|
|
|
|
|
|
resources.each do |resource|
|
|
|
|
def resource.procedures_count
|
2022-11-24 14:33:32 +01:00
|
|
|
procedures.with_discarded.count
|
2022-11-24 14:21:32 +01:00
|
|
|
end
|
2022-11-24 14:33:32 +01:00
|
|
|
|
|
|
|
def resource.last_sign_in_at = user.last_sign_in_at
|
|
|
|
def resource.current_sign_in_at = user.current_sign_in_at
|
2022-11-24 14:21:32 +01:00
|
|
|
end
|
|
|
|
|
2022-11-04 10:40:00 +01:00
|
|
|
page = Administrate::Page::Collection.new(dashboard)
|
|
|
|
|
|
|
|
render locals: {
|
|
|
|
resources: resources,
|
|
|
|
page: page,
|
2022-11-14 22:56:24 +01:00
|
|
|
show_search_bar: false,
|
|
|
|
search_term: nil
|
2022-11-04 10:40:00 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|