# frozen_string_literal: true
json.recordsTotal @projects.total_count
json.recordsFiltered @projects.length
json.data do
json.array! @projects do |project|
json.set! 'DT_RowId', project.id
json.set! '1', if project.archived
'' +
I18n.t('projects.index.archived')
else
'' +
I18n.t('projects.index.active')
end
json.set! '2', project.name
json.set! '3', I18n.l(project.created_at, format: :full)
json.set! '4', if project.visibility == 'hidden'
'' +
I18n.t('projects.index.hidden')
else
'' +
I18n.t('projects.index.visible')
end
json.set! '5', project.user_count
json.set! '6', project.experiment_count
json.set! '7', project.task_count
end
end