diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-07 20:13:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-07 20:13:15 +0000 |
commit | 8b205052a96416dd3313559343547fd850905921 (patch) | |
tree | 973f0b695a5ba1b642e034b6b570368632e4bd4f | |
parent | 1d71bd598f92b88941a2233a0e506ef322d8abde (diff) | |
download | redmine-8b205052a96416dd3313559343547fd850905921.tar.gz redmine-8b205052a96416dd3313559343547fd850905921.zip |
Don't wrap watcher link with span.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11334 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/watchers_helper.rb | 7 | ||||
-rw-r--r-- | app/views/boards/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/issues/_action_menu.html.erb | 2 | ||||
-rw-r--r-- | app/views/messages/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/news/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/watchers/_set_watcher.js.erb | 2 | ||||
-rw-r--r-- | app/views/wiki/date_index.html.erb | 2 | ||||
-rw-r--r-- | app/views/wiki/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/wiki/show.html.erb | 2 |
9 files changed, 12 insertions, 11 deletions
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) %> </div> <div id="add-message" style="display:none;"> diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index aade33970..4757ebcba 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,7 +1,7 @@ <div class="contextual"> <%= link_to l(:button_update), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %> <%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %> -<%= watcher_tag(@issue, User.current) %> +<%= watcher_link(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> </div> diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index db9a2c8af..37c072c3c 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -1,7 +1,7 @@ <%= board_breadcrumb(@message) %> <div class="contextual"> - <%= watcher_tag(@topic, User.current) %> + <%= watcher_link(@topic, User.current) %> <%= link_to( l(:button_quote), {:action => 'quote', :id => @topic}, diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index d4c0bae3e..d359e90b9 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -1,5 +1,5 @@ <div class="contextual"> -<%= watcher_tag(@news, User.current) %> +<%= watcher_link(@news, User.current) %> <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'icon icon-edit', diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb index 6283a3805..e5cdc4f3e 100644 --- a/app/views/watchers/_set_watcher.js.erb +++ b/app/views/watchers/_set_watcher.js.erb @@ -1,2 +1,2 @@ <% selector = ".#{watcher_css(watched)}" %> -$("<%= selector %>").each(function(){$(this).html("<%= escape_javascript watcher_link(watched, user) %>")}); +$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")}); diff --git a/app/views/wiki/date_index.html.erb b/app/views/wiki/date_index.html.erb index 4bc31dcd7..a543ef229 100644 --- a/app/views/wiki/date_index.html.erb +++ b/app/views/wiki/date_index.html.erb @@ -1,5 +1,5 @@ <div class="contextual"> -<%= watcher_tag(@wiki, User.current) %> +<%= watcher_link(@wiki, User.current) %> </div> <h2><%= l(:label_index_by_date) %></h2> diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb index 79cea66dd..333cc8531 100644 --- a/app/views/wiki/index.html.erb +++ b/app/views/wiki/index.html.erb @@ -1,5 +1,5 @@ <div class="contextual"> -<%= watcher_tag(@wiki, User.current) %> +<%= watcher_link(@wiki, User.current) %> </div> <h2><%= l(:label_index_by_title) %></h2> diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index dfb4add7c..b4386b754 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -2,7 +2,7 @@ <% if @editable %> <% if @content.current_version? %> <%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> - <%= watcher_tag(@page, User.current) %> + <%= watcher_link(@page, User.current) %> <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') %> |