diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-02-05 19:33:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-02-05 19:33:43 +0000 |
commit | 08ff4dfb216c0a95fedaed1ee5e55c9cf83e7710 (patch) | |
tree | 83a69ae9e7eb298b0269f79d3ba2b2ae152a1999 /app/controllers/my_controller.rb | |
parent | 2e72f2eca8f441a6ea89e71033837b9cd677d4a5 (diff) | |
download | redmine-08ff4dfb216c0a95fedaed1ee5e55c9cf83e7710.tar.gz redmine-08ff4dfb216c0a95fedaed1ee5e55c9cf83e7710.zip |
removed underscores in block names (problem with scriptaculous sortables)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@242 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/my_controller.rb')
-rw-r--r-- | app/controllers/my_controller.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index ec6b88b4c..e29c78e03 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -19,13 +19,17 @@ class MyController < ApplicationController layout 'base' before_filter :require_login - BLOCKS = { 'issues_assigned_to_me' => :label_assigned_to_me_issues, - 'issues_reported_by_me' => :label_reported_issues, - 'latest_news' => :label_news_latest, + BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues, + 'issuesreportedbyme' => :label_reported_issues, + 'news' => :label_news_latest, 'calendar' => :label_calendar, 'documents' => :label_document_plural }.freeze + DEFAULT_LAYOUT = { 'left' => ['issuesassignedtome'], + 'right' => ['issuesreportedbyme'] + }.freeze + verify :xhr => true, :session => :page_layout, :only => [:add_block, :remove_block, :order_blocks] @@ -38,7 +42,7 @@ class MyController < ApplicationController # Show user's page def page @user = self.logged_in_user - @blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] } + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT end # Edit user's account @@ -75,7 +79,7 @@ class MyController < ApplicationController # User's page layout configuration def page_layout @user = self.logged_in_user - @blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] } + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT session[:page_layout] = @blocks %w(top left right).each {|f| session[:page_layout][f] ||= [] } @block_options = [] |