<%=l(:label_related_issues)%> <% if authorize_for('issue_relations', 'create') %> (<%= toggle_link l(:label_add_related_issues), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>) <% end %>

<% if @relations.present? %> <%= render :partial => 'issues/relation', :collection => @relations, :as => :relation %>
<% end %> <% form_for(@issue.new_relation, :as => :relation, :url => issue_relations_path(@issue), :method => :post, :remote => true, :complete => "Form.Element.focus('relation_issue_to_id');", :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %> <%= render :partial => 'issue_relations/form', :locals => {:f => f}%> <% end %>