On 12/15/2010 09:59 AM, tsedovic@redhat.com wrote:
From: Tomas Sedovictsedovic@redhat.com
Going to:
http://example.com/set_layout?layout=newui
sets the new UI layout, going here:
http://example.com/set_layout?layout=aggregator
sets the old one.
src/app/controllers/application_controller.rb | 7 +++++++ src/config/routes.rb | 2 ++ 2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 7d0e931..fd1a92c 100644 --- a/src/app/controllers/application_controller.rb +++ b/src/app/controllers/application_controller.rb @@ -49,6 +49,13 @@ class ApplicationController< ActionController::Base return @layout end
- def set_layout
- if not params[:layout].blank?
cookies[:layout] = params[:layout]
- end
- render :text => "Current layout is: '#{cookies[:layout]}'"
- end
- def section_id 'generic' end
diff --git a/src/config/routes.rb b/src/config/routes.rb index f4e4bb8..c1964ec 100644 --- a/src/config/routes.rb +++ b/src/config/routes.rb @@ -40,6 +40,8 @@ ActionController::Routing::Routes.draw do |map| r.resources :assemblies, :deployables, :templates end
- map.connect '/set_layout', :controller => 'application', :action => 'set_layout'
- map.namespace 'admin' do |r| r.resources :hardware_profiles, :pool_families, :providers, :provider_accounts, :realms, :roles, :settings, :users end
ACK. Goal of this patch is to enable writing cuke tests for new UI (it wasn't possible to switch layout w/o this).
Jan