OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/issues/_subissues_paragraph.rhtml

26 lines
1018 B

<strong><%= l(:label_issue_hierarchy) %></strong>
(<%= link_to(l(:label_add_subtask), {:controller => 'issues', :action => 'new', :project_id => @project, :issue => {:parent_issue_id => @issue}}) if User.current.allowed_to?(:manage_subtasks, @project) %>)
<% indent = 0 %>
<form action="#">
<table id="issue_tree" class="list">
<!-- render parent elements -->
<% @issue.ancestors.each do |issue| %>
<%= render :partial => 'subissue_row', :locals => { :issue => issue, :level => indent, :relation => "parent" } %>
<% indent += 1 %>
<% end %>
<!-- render current element -->
<%= render :partial => 'subissue_row', :locals => { :issue => @issue, :level => indent, :relation => "root" } %>
<% indent += 1 %>
<!-- render child elements -->
<% issue_list(@issue.descendants.sort_by(&:lft)) do |issue, level| %>
<%= render :partial => 'subissue_row', :locals => { :issue => issue, :level => indent + level, :relation => "child" } %>
<% end %>
</table>
</form>