Move issue watchers to the sidebar.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3579 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-03-13 17:45:41 +00:00
parent 8cc519e763
commit e605973ec4
4 changed files with 36 additions and 27 deletions
+7 -5
View File
@@ -48,8 +48,8 @@ module WatchersHelper
# Returns a comma separated list of users watching the given object
def watchers_list(object)
remove_allowed = User.current.allowed_to?("delete_#{object.class.name.underscore}_watchers".to_sym, object.project)
object.watcher_users.collect do |user|
s = content_tag('span', link_to_user(user), :class => 'user')
lis = object.watcher_users.collect do |user|
s = avatar(user, :size => "16").to_s + link_to_user(user, :class => 'user').to_s
if remove_allowed
url = {:controller => 'watchers',
:action => 'destroy',
@@ -59,9 +59,11 @@ module WatchersHelper
s += ' ' + link_to_remote(image_tag('delete.png'),
{:url => url},
:href => url_for(url),
:style => "vertical-align: middle")
:style => "vertical-align: middle",
:class => "delete")
end
s
end.join(",\n")
"<li>#{ s }</li>"
end
lis.empty? ? "" : "<ul>#{ lis.join("\n") }</ul>"
end
end