removed underscores in block names (problem with scriptaculous sortables)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@242 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-02-05 19:33:43 +00:00
parent 2e72f2eca8
commit 08ff4dfb21
4 changed files with 9 additions and 5 deletions

View File

@ -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 = []