summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-09 19:08:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-09 19:08:02 +0000
commiteb0a93d353bd04a82303c8faaefe38493fcd9f9d (patch)
treed293e16afdba98a2bfd176419ca0c05f1e7efae5 /app/controllers
parentd171aa83988b08e1aa3a0a23345635af0db83f1e (diff)
downloadredmine-eb0a93d353bd04a82303c8faaefe38493fcd9f9d.tar.gz
redmine-eb0a93d353bd04a82303c8faaefe38493fcd9f9d.zip
Removes MyControllerTest#page_layout (#25297).
git-svn-id: http://svn.redmine.org/redmine/trunk@16385 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/my_controller.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index be1c3c36d..7d8770776 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -142,12 +142,6 @@ class MyController < ApplicationController
@updated_blocks = block_settings.keys
end
- # User's page layout configuration
- def page_layout
- @user = User.current
- @blocks = @user.pref.my_page_layout
- end
-
# Add a block to user's page
# The block is added on top of the page
# params[:block] : id of the block to add
@@ -155,7 +149,7 @@ class MyController < ApplicationController
@user = User.current
@user.pref.add_block params[:block]
@user.pref.save
- redirect_to my_page_layout_path
+ redirect_to my_page_path
end
# Remove a block to user's page
@@ -164,18 +158,17 @@ class MyController < ApplicationController
@user = User.current
@user.pref.remove_block params[:block]
@user.pref.save
- redirect_to my_page_layout_path
+ redirect_to my_page_path
end
# Change blocks order on user's page
# params[:group] : group to order (top, left or right)
# params[:blocks] : array of block ids of the group
def order_blocks
- group = params[:group]
@user = User.current
- if group.is_a?(String)
- group_items = (params["blocks"] || []).collect(&:underscore)
- group_items.each {|s| s.sub!(/^block_/, '')}
+ group = params[:group].to_s
+ if %w(top left right).include? group
+ group_items = (params[:blocks] || []).collect(&:underscore)
# remove group blocks if they are presents in other groups
group_items.each {|s| @user.pref.remove_block(s)}
@user.pref.my_page_layout[group] = group_items