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.
18 lines
646 B
18 lines
646 B
json.author do
|
|
json.partial! "users/user_simple", user: message.user
|
|
end
|
|
|
|
json.id message.id
|
|
json.content content_safe(message.contents_show(identity))
|
|
# json.content message.contents_show(identity)
|
|
json.time time_from_now(message.created_at)
|
|
json.hidden message.hidden
|
|
# 主贴与子贴不一致
|
|
if message.m_parent_id
|
|
json.can_delete message.can_delete(identity)
|
|
else
|
|
json.praise_count message.praise_treads.select{|pt| pt.praise_or_tread == 1}.count
|
|
json.user_praise message.praise_treads.select{|pt| pt.praise_or_tread == 1 && pt.user_id == current_user.id}.count
|
|
json.child_message_count message.m_reply_count
|
|
end
|