mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
shorten long line of WatchersController
git-svn-id: http://svn.redmine.org/redmine/trunk@20272 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -50,7 +50,11 @@ class WatchersController < ApplicationController
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to_referer_or {render :html => 'Watcher added.', :status => 200, :layout => true}}
|
||||
format.html do
|
||||
redirect_to_referer_or do
|
||||
render(:html => 'Watcher added.', :status => 200, :layout => true)
|
||||
end
|
||||
end
|
||||
format.js {@users = users_for_new_watcher}
|
||||
format.api {render_api_ok}
|
||||
end
|
||||
@@ -72,7 +76,11 @@ class WatchersController < ApplicationController
|
||||
watchable.set_watcher(user, false)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to_referer_or {render :html => 'Watcher removed.', :status => 200, :layout => true} }
|
||||
format.html do
|
||||
redirect_to_referer_or do
|
||||
render(:html => 'Watcher removed.', :status => 200, :layout => true)
|
||||
end
|
||||
end
|
||||
format.js
|
||||
format.api {render_api_ok}
|
||||
end
|
||||
@@ -113,9 +121,14 @@ class WatchersController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
text = watching ? 'Watcher added.' : 'Watcher removed.'
|
||||
redirect_to_referer_or {render :html => text, :status => 200, :layout => true}
|
||||
redirect_to_referer_or do
|
||||
render(:html => text, :status => 200, :layout => true)
|
||||
end
|
||||
end
|
||||
format.js do
|
||||
render(:partial => 'set_watcher',
|
||||
:locals => {:user => user, :watched => watchables})
|
||||
end
|
||||
format.js { render :partial => 'set_watcher', :locals => {:user => user, :watched => watchables} }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user