diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-08-03 09:14:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-08-03 09:14:43 +0000 |
commit | a332e0a4febeb36aac41f8d5762d18f4cbbf115c (patch) | |
tree | 8e0883bbdbfd7bfca332880da6f1739362b8c579 /app/helpers/watchers_helper.rb | |
parent | 6034067d8623e87ef1391962b882fcc93196bf4b (diff) | |
download | redmine-a332e0a4febeb36aac41f8d5762d18f4cbbf115c.tar.gz redmine-a332e0a4febeb36aac41f8d5762d18f4cbbf115c.zip |
Adds permissions for viewing the watcher list and adding new watchers on the issue detail view (#398).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1712 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/watchers_helper.rb')
-rw-r--r-- | app/helpers/watchers_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index c83c785fc..f4767ebed 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -24,7 +24,7 @@ module WatchersHelper return '' unless user && user.logged? && object.respond_to?('watched_by?') watched = object.watched_by?(user) url = {:controller => 'watchers', - :action => (watched ? 'remove' : 'add'), + :action => (watched ? 'unwatch' : 'watch'), :object_type => object.class.to_s.underscore, :object_id => object.id} link_to_remote((watched ? l(:button_unwatch) : l(:button_watch)), @@ -33,4 +33,9 @@ module WatchersHelper :class => (watched ? 'icon icon-fav' : 'icon icon-fav-off')) end + + # Returns a comma separated list of users watching the given object + def watchers_list(object) + object.watcher_users.collect {|u| content_tag('span', link_to_user(u), :class => 'user') }.join(",\n") + end end |