mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18441 e93f8b46-1217-0410-a6f0-8f06a7374b81
25 lines
841 B
Plaintext
25 lines
841 B
Plaintext
api.news do
|
|
api.id @news.id
|
|
api.project(:id => @news.project_id, :name => @news.project.name) unless @news.project.nil?
|
|
api.author(:id => @news.author_id, :name => @news.author.name) unless @news.author.nil?
|
|
api.title @news.title
|
|
api.summary @news.summary unless @news.summary.blank?
|
|
api.description @news.description
|
|
api.created_on @news.created_on
|
|
|
|
api.array :attachments do
|
|
@news.attachments.each do |attachment|
|
|
render_api_attachment(attachment, api)
|
|
end
|
|
end if include_in_api_response?('attachments')
|
|
|
|
api.array :comments do
|
|
@comments.each do |comment|
|
|
api.comment :id => comment.id do
|
|
api.author(:id => comment.author_id, :name => comment.author.name) unless comment.author.nil?
|
|
api.content comment.content
|
|
end
|
|
end
|
|
end if include_in_api_response?('comments')
|
|
end
|