diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-17 16:58:44 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-17 16:58:44 +0000 |
commit | b8fbb41d5f6360749b0e6137a74d008f892122ac (patch) | |
tree | 51abd0e93c9eb7212c8406d9accca7b26137f190 | |
parent | 0a000921f87c078cb1cf4695fa6a93321eb17b90 (diff) | |
download | redmine-b8fbb41d5f6360749b0e6137a74d008f892122ac.tar.gz redmine-b8fbb41d5f6360749b0e6137a74d008f892122ac.zip |
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
-rw-r--r-- | app/helpers/issues_helper.rb | 5 | ||||
-rw-r--r-- | app/views/issues/show.html.erb | 2 |
2 files changed, 6 insertions, 1 deletions
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 %> <hr /> <div id="issue_tree"> <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> <p><strong><%=l(:label_subtask_plural)%></strong></p> <%= render_descendants_tree(@issue) unless @issue.leaf? %> |