summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-24 12:57:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-24 12:57:28 +0000
commitfae5250e52506356965a478518aa7960ada3ec61 (patch)
tree91db93da34e2437bd9b0e9017fb7dd38eb275b30 /app/helpers
parente2bb8721d9e0b41094f7a7c768951235492dc3e4 (diff)
downloadredmine-fae5250e52506356965a478518aa7960ada3ec61.tar.gz
redmine-fae5250e52506356965a478518aa7960ada3ec61.zip
Ability to add non-member watchers on issue creation (#5159).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9254 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/watchers_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index 74bb0e1ec..fb77a90ae 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -63,4 +63,12 @@ module WatchersHelper
end
(lis.empty? ? "" : "<ul>#{ lis.join("\n") }</ul>").html_safe
end
+
+ def watchers_checkboxes(object, users, checked=nil)
+ users.map do |user|
+ c = checked.nil? ? object.watched_by?(user) : checked
+ tag = check_box_tag 'issue[watcher_user_ids][]', user.id, c, :id => nil
+ content_tag 'label', "#{tag} #{h(user)}", :id => "issue_watcher_user_ids_#{user.id}", :class => "floating"
+ end.join
+ end
end