Adds a helper for displaying a link to add a subtask (#12113).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10661 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-10-17 16:58:44 +00:00
parent 0a000921f8
commit b8fbb41d5f
2 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,11 @@ module IssuesHelper
s.html_safe s.html_safe
end 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 class IssueFieldsRows
include ActionView::Helpers::TagHelper include ActionView::Helpers::TagHelper

View File

@ -93,7 +93,7 @@ end %>
<hr /> <hr />
<div id="issue_tree"> <div id="issue_tree">
<div class="contextual"> <div class="contextual">
<%= 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) %>
</div> </div>
<p><strong><%=l(:label_subtask_plural)%></strong></p> <p><strong><%=l(:label_subtask_plural)%></strong></p>
<%= render_descendants_tree(@issue) unless @issue.leaf? %> <%= render_descendants_tree(@issue) unless @issue.leaf? %>