end
def show
- @journals = @issue.visible_journals_with_index
- @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists? unless api_request?
- @relations =
- @issue.relations.
- select do |r|
- r.other_issue(@issue) && r.other_issue(@issue).visible?
- end
- @journals.reverse! if User.current.wants_comments_in_reverse_order?
+ if !api_request? || include_in_api_response?('journals')
+ @journals = @issue.visible_journals_with_index
+ @journals.reverse! if User.current.wants_comments_in_reverse_order?
+ end
+ if !api_request? || include_in_api_response?('relations')
+ @relations = @issue.relations.select {|r| r.other_issue(@issue)&.visible?}
+ end
+ if !api_request? || include_in_api_response?('allowed_statuses')
+ @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
+ end
if User.current.allowed_to?(:view_time_entries, @project)
Issue.load_visible_spent_hours([@issue])
respond_to do |format|
format.html do
- @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@priorities = IssuePriority.active
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@time_entries = @issue.time_entries.visible.preload(:activity, :user)
@relation = IssueRelation.new
+ @has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
retrieve_previous_and_next_issue_ids
render :template => 'issues/show'
end
format.api do
- @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
if include_in_api_response?('changesets')
@changesets = @issue.changesets.visible.preload(:repository, :user).to_a
@changesets.reverse! if User.current.wants_comments_in_reverse_order?