mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
20 lines
813 B
Ruby
20 lines
813 B
Ruby
# frozen_string_literal: true
|
|
|
|
json.data do
|
|
json.array! @projects do |project|
|
|
json.set! 'id', project.id
|
|
json.set! 'archived', project.archived
|
|
json.set! 'name', project.name
|
|
json.set! 'created_at', I18n.l(project.created_at, format: :full)
|
|
json.set! 'visibility', if project.visibility == 'hidden'
|
|
'<i class="fas fa-eye-slash"></i>' +
|
|
I18n.t('projects.index.hidden')
|
|
else
|
|
'<i class="fas fa-eye"></i>' +
|
|
I18n.t('projects.index.visible')
|
|
end
|
|
json.set! 'user_count', project.user_count
|
|
json.set! 'notification_count', project.notification_count
|
|
json.set! 'comment_count', project.comment_count
|
|
end
|
|
end
|