diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-18 18:26:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-18 18:26:10 +0000 |
commit | 7e5bad993de613e5618a651a0f822f5e4fa0d941 (patch) | |
tree | 4c118ea12135887ff14a4917b21347a14f6e37fe /app/controllers/my_controller.rb | |
parent | c9a46950de1bbcd7e4b326dcc619ffacd4cac713 (diff) | |
download | redmine-7e5bad993de613e5618a651a0f822f5e4fa0d941.tar.gz redmine-7e5bad993de613e5618a651a0f822f5e4fa0d941.zip |
Removes most of the ajax stuff on my page layout.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10033 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/my_controller.rb')
-rw-r--r-- | app/controllers/my_controller.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index cfa7531b0..d92494540 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -135,7 +135,11 @@ class MyController < ApplicationController @user = User.current @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT.dup @block_options = [] - BLOCKS.each {|k, v| @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize]} + BLOCKS.each do |k, v| + unless %w(top left right).detect {|f| (@blocks[f] ||= []).include?(k)} + @block_options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize] + end + end end # Add a block to user's page @@ -152,7 +156,7 @@ class MyController < ApplicationController layout['top'].unshift block @user.pref[:my_page_layout] = layout @user.pref.save - render :partial => "block", :locals => {:user => @user, :block_name => block} + redirect_to :action => 'page_layout' end # Remove a block to user's page @@ -165,7 +169,7 @@ class MyController < ApplicationController %w(top left right).each {|f| (layout[f] ||= []).delete block } @user.pref[:my_page_layout] = layout @user.pref.save - render :nothing => true + redirect_to :action => 'page_layout' end # Change blocks order on user's page |