diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index a4213c6be..09d6ed5fa 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -94,6 +94,11 @@ module IssuesHelper s.html_safe end + # Returns a link for adding a new subtask to the given issue + def link_to_new_subtask(issue) + link_to(l(:button_add), {:controller => 'issues', :action => 'new', :project_id => issue.project, :issue => {:parent_issue_id => issue}}) + end + class IssueFieldsRows include ActionView::Helpers::TagHelper diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 1313c833c..308f93b61 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -93,7 +93,7 @@ end %>
- <%= link_to(l(:button_add), {:controller => 'issues', :action => 'new', :project_id => @project, :issue => {:parent_issue_id => @issue}}) if User.current.allowed_to?(:manage_subtasks, @project) %> + <%= link_to_new_subtask(@issue) if User.current.allowed_to?(:manage_subtasks, @project) %>

<%=l(:label_subtask_plural)%>

<%= render_descendants_tree(@issue) unless @issue.leaf? %>