summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-13 17:32:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-13 17:32:26 +0000
commit9548d39a15c15338c790f18cdced3b17029af282 (patch)
treeea5e1de22704396fb0729550dfaca76a1a18f469 /app
parent2b124f1e61da30a103f78a645e0237cb8c14d577 (diff)
downloadredmine-9548d39a15c15338c790f18cdced3b17029af282.tar.gz
redmine-9548d39a15c15338c790f18cdced3b17029af282.zip
Moved users list diplayed as available watchers on the new issue form to an helper.
git-svn-id: http://svn.redmine.org/redmine/trunk@13995 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/issues_controller.rb4
-rw-r--r--app/helpers/issues_helper.rb10
-rw-r--r--app/views/issues/new.html.erb2
3 files changed, 11 insertions, 5 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b95856a19..13de1661a 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -466,10 +466,6 @@ class IssuesController < ApplicationController
@priorities = IssuePriority.active
@allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?)
- @available_watchers = @issue.watcher_users
- if @issue.project.users.count <= 20
- @available_watchers = (@available_watchers + @issue.project.users.sort).uniq
- end
end
def parse_params_for_bulk_issue_attributes(params)
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 82b8905e2..885b1c5b1 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -217,6 +217,16 @@ module IssuesHelper
message
end
+ # Returns an array of users that are proposed as watchers
+ # on the new issue form
+ def users_for_new_issue_watchers(issue)
+ users = issue.watcher_users
+ if issue.project.users.count <= 20
+ users = (users + issue.project.users.sort).uniq
+ end
+ users
+ end
+
def sidebar_queries
unless @sidebar_queries
@sidebar_queries = IssueQuery.visible.
diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb
index 206df8d18..f168c39a4 100644
--- a/app/views/issues/new.html.erb
+++ b/app/views/issues/new.html.erb
@@ -35,7 +35,7 @@
<% if @issue.safe_attribute? 'watcher_user_ids' -%>
<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
<span id="watchers_inputs">
- <%= watchers_checkboxes(@issue, @available_watchers) %>
+ <%= watchers_checkboxes(@issue, users_for_new_issue_watchers(@issue)) %>
</span>
<span class="search_for_watchers">
<%= link_to l(:label_search_for_watchers),