You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/tidings/_tiding.json.jbuilder

25 lines
1012 B

json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type,
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type
6 years ago
json.content tiding.content
6 years ago
json.identifier tiding.identifier
json.auth_type tiding.container_type == 'ApplyUserAuthentication' ? tiding.container.auth_type : nil
6 years ago
homework_type = nil
if tiding.container_type == 'HomeworkCommon'
homework_type = tiding.container.homework_type rescue nil
6 years ago
end
if homework_type.blank? && tiding.parent_container_type == 'HomeworkCommon'
homework_type = tiding.parent_container.homework_type rescue nil
6 years ago
end
json.homework_type homework_type
6 years ago
json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time)
6 years ago
json.trigger_user do
json.partial! 'users/user_simple', user: tiding.trigger_user_id.zero? ? User.find(1) : tiding.trigger_user
6 years ago
end
json.attachments tiding.attachments, partial: 'attachments/attachment_small', as: :attachment