From 08ff4dfb216c0a95fedaed1ee5e55c9cf83e7710 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 5 Feb 2007 19:33:43 +0000 Subject: [PATCH] removed underscores in block names (problem with scriptaculous sortables) git-svn-id: http://redmine.rubyforge.org/svn/trunk@242 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/my_controller.rb | 14 +++++++++----- ...igned_to_me.rhtml => _issuesassignedtome.rhtml} | 0 ...orted_by_me.rhtml => _issuesreportedbyme.rhtml} | 0 .../my/blocks/{_latest_news.rhtml => _news.rhtml} | 0 4 files changed, 9 insertions(+), 5 deletions(-) rename app/views/my/blocks/{_issues_assigned_to_me.rhtml => _issuesassignedtome.rhtml} (100%) rename app/views/my/blocks/{_issues_reported_by_me.rhtml => _issuesreportedbyme.rhtml} (100%) rename app/views/my/blocks/{_latest_news.rhtml => _news.rhtml} (100%) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index ec6b88b4..e29c78e0 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 = [] diff --git a/app/views/my/blocks/_issues_assigned_to_me.rhtml b/app/views/my/blocks/_issuesassignedtome.rhtml similarity index 100% rename from app/views/my/blocks/_issues_assigned_to_me.rhtml rename to app/views/my/blocks/_issuesassignedtome.rhtml diff --git a/app/views/my/blocks/_issues_reported_by_me.rhtml b/app/views/my/blocks/_issuesreportedbyme.rhtml similarity index 100% rename from app/views/my/blocks/_issues_reported_by_me.rhtml rename to app/views/my/blocks/_issuesreportedbyme.rhtml diff --git a/app/views/my/blocks/_latest_news.rhtml b/app/views/my/blocks/_news.rhtml similarity index 100% rename from app/views/my/blocks/_latest_news.rhtml rename to app/views/my/blocks/_news.rhtml