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.
23 lines
701 B
23 lines
701 B
json.author do
|
|
json.partial! 'users/user', user: discuss.user
|
|
end
|
|
json.id discuss.id
|
|
json.content discuss.content
|
|
json.time time_from_now(discuss.created_at)
|
|
json.position discuss.position
|
|
json.shixun_id discuss.dis_id
|
|
json.hidden discuss.hidden
|
|
json.manage @manger
|
|
json.reward discuss.reward
|
|
#json.game_url discuss.game_url(container, current_user)
|
|
json.game_url "/tasks/#{discuss.identifier}" if @manger && !children
|
|
# 主贴和回复有一些不同点
|
|
if discuss.parent_id
|
|
json.can_delete discuss.can_deleted?(current_user)
|
|
else
|
|
json.praise_count discuss.praises_count
|
|
json.user_praise discuss.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
|
|
end
|
|
|
|
|