<%#-- copyright OpenProject is a project management system. Copyright (C) 2012-2013 the OpenProject Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3. See doc/COPYRIGHT.rdoc for more details. ++#%>

<%=l(:label_related_work_packages)%> <% if authorize_for('work_package_relations', 'create') %> (<%= toggle_link l(:label_add_related_work_packages), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>) <% end %>

<%= render :partial => 'relation', :collection => relations, :as => :relation, :locals => { :work_package => work_package } -%>
<%= form_for(controller.work_package.new_relation, :as => :relation, :url => work_package_relations_path(work_package), :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 => 'work_package_relations/form', :locals => {:f => f}%> <% end %>