From: Tomas Sedovic <tsedovic(a)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
--
1.7.3.3