diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 10d5a66ce..5b3b1b7b4 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -20,19 +20,20 @@ module WatchersHelper def watcher_tag(object, user, options={}) - content_tag("span", watcher_link(object, user), :class => watcher_css(object)) + ActiveSupport::Deprecation.warn "#watcher_tag is deprecated and will be removed in Redmine 3.0. Use #watcher_link instead." + watcher_link(object, user) end def watcher_link(object, user) return '' unless user && user.logged? && object.respond_to?('watched_by?') watched = object.watched_by?(user) + css = [watcher_css(object), watched ? 'icon icon-fav' : 'icon icon-fav-off'].join(' ') url = {:controller => 'watchers', :action => (watched ? 'unwatch' : 'watch'), :object_type => object.class.to_s.underscore, :object_id => object.id} link_to((watched ? l(:button_unwatch) : l(:button_watch)), url, - :remote => true, :method => 'post', :class => (watched ? 'icon icon-fav' : 'icon icon-fav-off')) - + :remote => true, :method => 'post', :class => css) end # Returns the css class used to identify watch links for a given +object+ diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 1a006a6ad..f5e9b1295 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -5,7 +5,7 @@ new_board_message_path(@board), :class => 'icon icon-add', :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %> -<%= watcher_tag(@board, User.current) %> +<%= watcher_link(@board, User.current) %>