Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> use-activeresource : adapt frontend to backend which return controller and action
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Tue, 25 Aug 2009 17:41:52 +0200
  • Message-id: <E1MoJ2O-0003E4-Jt@xxxxxxxxxxxxxxxx>
ref: refs/heads/use-activeresource
commit 7c8b1c8cc2648715f1523e1e25acb5bcd59bbb87
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Tue Aug 25 17:41:52 2009 +0200

adapt frontend to backend which return controller and action
---
.../app/controllers/controlpanel_controller.rb | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/webclient/app/controllers/controlpanel_controller.rb
b/webclient/app/controllers/controlpanel_controller.rb
index 650cd0b..b9ba795 100644
--- a/webclient/app/controllers/controlpanel_controller.rb
+++ b/webclient/app/controllers/controlpanel_controller.rb
@@ -122,7 +122,7 @@ class ControlpanelController < ApplicationController
# session variable is used to find out, if basic system module is needed
return false if session[:wizard_current] == FINAL_STEP
# basic system setup in progress => redirect to current module
- redirect_to :controller => session[:wizard_current]
+ redirect_to get_redirect_hash(session[:wizard_current])
return true
else
basesystem = load_proxy 'org.opensuse.yast.modules.basesystem'
@@ -141,10 +141,19 @@ class ControlpanelController < ApplicationController
# we got some steps from backend, base system setup is not over and
# no sign of progress in session variables => restart base system setup
logger.debug "Basesystem steps: #{basesystem.steps.inspect}"
- session[:wizard_steps] = basesystem.steps.join(",")
- session[:wizard_current] = basesystem.steps.first
- redirect_to :controller => basesystem.steps.first
+ decoded_steps = basesystem.steps.collect { |step| step.action ?
"#{step.controller}:#{step.action}" : step.controller }
+ session[:wizard_steps] = decoded_steps.join(",")
+ session[:wizard_current] = decoded_steps.first
+ redirect_to get_redirect_hash(session[:wizard_current])
return true
end
end
+
+ def get_redirect_hash (target)
+ arr = target.split(":")
+ ret = { :controller => arr[0], :action => arr[1]||"index"}
+ logger.debug ret.inspect
+ return ret
+ end
+
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages