@journals.reverse! if User.current.wants_comments_in_reverse_order?
@changesets = @issue.changesets.visible.all
@changesets.reverse! if User.current.wants_comments_in_reverse_order?
+ @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@priorities = IssuePriority.all
<p><strong><%=l(:label_related_issues)%></strong></p>
-<% if @issue.relations.any? %>
+<% if @relations.present? %>
<table style="width:100%">
-<% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
+<% @relations.each do |relation| %>
<tr>
<td><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
<%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
render_api_issue_children(@issue, api) if include_in_api_response?('children')
api.array :relations do
- @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation|
+ @relations.each do |relation|
api.relation(:id => relation.id, :issue_id => relation.other_issue(@issue).id, :relation_type => relation.relation_type_for(@issue), :delay => relation.delay)
end
- end if include_in_api_response?('relations')
+ end if include_in_api_response?('relations') && @relations.present?
api.array :changesets do
@issue.changesets.each do |changeset|