##// END OF EJS Templates
Introduce virtual MenuNodes (#15880)....
Introduce virtual MenuNodes (#15880). They are characterized by having a blank url. they will only be rendered if the user is authorized to see at least one of its children. they render as links which do nothing when clicked. Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@15501 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r15032:0e59482e90a7
r15119:53710d80fc88
Show More
show.api.rsb
80 lines | 3.3 KiB | text/plain | TextLexer
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.issue do
Jean-Philippe Lang
Fixes indentation....
r4373 api.id @issue.id
api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil?
api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil?
api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil?
api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil?
api.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil?
api.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil?
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil?
api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil?
api.parent(:id => @issue.parent_id) unless @issue.parent.nil?
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Fixes indentation....
r4373 api.subject @issue.subject
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.description @issue.description
Jean-Philippe Lang
Fixes indentation....
r4373 api.start_date @issue.start_date
api.due_date @issue.due_date
api.done_ratio @issue.done_ratio
Jean-Philippe Lang
Issue API: include is_private attribute in xml/json output (#10914)....
r13032 api.is_private @issue.is_private
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.estimated_hours @issue.estimated_hours
Jean-Philippe Lang
Total spent hours and estimated hours need to be get via REST (#21757)....
r14872 api.total_estimated_hours @issue.total_estimated_hours
if User.current.allowed_to?(:view_time_entries, @project)
api.spent_hours(@issue.spent_hours)
api.total_spent_hours(@issue.total_spent_hours)
end
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Role-based issue custom field visibility (#5037)....
r11782 render_api_custom_values @issue.visible_custom_field_values, api
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.created_on @issue.created_on
api.updated_on @issue.updated_on
Jean-Philippe Lang
Adds closed_on to issues API responses (#824)....
r11181 api.closed_on @issue.closed_on
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Makes some attributes optional in API response to get faster/lightweight responses....
r4372 render_api_issue_children(@issue, api) if include_in_api_response?('children')
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
REST API for reading attachments (#7671)....
r6175 api.array :attachments do
@issue.attachments.each do |attachment|
render_api_attachment(attachment, api)
end
end if include_in_api_response?('attachments')
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.array :relations do
Jean-Philippe Lang
Moves relations fetching from views to the controller and skip invalid relations (#7385)....
r4621 @relations.each do |relation|
Jean-Philippe Lang
Adds support for GET on /issues/:issue_id/relations (#7366)....
r6059 api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay)
Jean-Philippe Lang
Fixes indentation....
r4373 end
Jean-Philippe Lang
Moves relations fetching from views to the controller and skip invalid relations (#7385)....
r4621 end if include_in_api_response?('relations') && @relations.present?
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.array :changesets do
Jean-Philippe Lang
Fixed that Issues API may disclose changesets that are not visible (#21136)....
r14412 @changesets.each do |changeset|
Jean-Philippe Lang
Fixes indentation....
r4373 api.changeset :revision => changeset.revision do
api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil?
api.comments changeset.comments
api.committed_on changeset.committed_on
end
end
Jean-Philippe Lang
Fixed that Issues API may disclose changesets that are not visible (#21136)....
r14412 end if include_in_api_response?('changesets')
Toshi MARUYAMA
remove trailing white-spaces from app/views/issues/show.api.rsb...
r7135
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 api.array :journals do
Jean-Philippe Lang
Private issue notes (#1554)....
r10336 @journals.each do |journal|
Jean-Philippe Lang
Fixes indentation....
r4373 api.journal :id => journal.id do
api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
api.notes journal.notes
Jean-Philippe Lang
Adds journal created_on attribute to issue API (#7111)....
r4398 api.created_on journal.created_on
Jean-Philippe Lang
Include private_notes property in xml/json Journals output (#20985)....
r15032 api.private_notes journal.private_notes
Jean-Philippe Lang
Fixes indentation....
r4373 api.array :details do
Jean-Philippe Lang
Role-based issue custom field visibility (#5037)....
r11782 journal.visible_details.each do |detail|
Jean-Philippe Lang
Fixes indentation....
r4373 api.detail :property => detail.property, :name => detail.prop_key do
api.old_value detail.old_value
api.new_value detail.value
end
end
end
end
end
Jean-Philippe Lang
Makes some attributes optional in API response to get faster/lightweight responses....
r4372 end if include_in_api_response?('journals')
Jean-Philippe Lang
Add/remove issue watchers via the REST API (#6727)....
r11060
api.array :watchers do
@issue.watcher_users.each do |user|
api.user :id => user.id, :name => user.name
end
end if include_in_api_response?('watchers') && User.current.allowed_to?(:view_issue_watchers, @issue.project)
Jean-Philippe Lang
Converts IssuesController to use the new API template system and makes xml/json responses consistent (#6136)....
r4344 end