ref: refs/heads/master
commit 2025e86d7b301e20e5ca0a15f69fb1cda65c0ea8
Author: Josef Reidinger
Date: Thu Aug 20 13:25:39 2009 +0200
first initial working version of base system, expect rapid changes
---
.../app/controllers/controlpanel_controller.rb | 18 ++++++++++++++----
webclient/app/views/layouts/main.rhtml | 5 +++++
webclient/start.sh | 2 +-
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/webclient/app/controllers/controlpanel_controller.rb b/webclient/app/controllers/controlpanel_controller.rb
index d6676ed..55ef658 100644
--- a/webclient/app/controllers/controlpanel_controller.rb
+++ b/webclient/app/controllers/controlpanel_controller.rb
@@ -12,7 +12,6 @@ class ControlpanelController < ApplicationController
def index
return false if need_redirect
- session[:wizard_mode] = nil #clean wizard mode request from session
@shortcuts = shortcuts_data
end
@@ -35,7 +34,17 @@ class ControlpanelController < ApplicationController
format.json { render :json => shortcuts_data.to_json, :location => "none" }
end
end
-
+
+
+ def nextstep
+ logger.debug "next step in base system"
+ proxy = YaST::ServiceResource.proxy_for 'org.opensuse.yast.modules.basesystem'
+ basesystem = proxy.find
+ basesystem.current = session[:wizard_mode]
+ basesystem.save
+ redirect_to "/controlpanel"
+ end
+
protected
# reads the shortcuts and returns the
@@ -80,6 +89,7 @@ class ControlpanelController < ApplicationController
FINAL_STEP = "FINISH"
# Checks if basic system modul need show another module instead control panel
def need_redirect
+ session[:wizard_mode] = nil #clean wizard mode request from session
basesystem = load_proxy 'org.opensuse.yast.modules.basesystem'
unless basesystem
erase_redirect_results #reset all error redirects
@@ -89,9 +99,9 @@ class ControlpanelController < ApplicationController
return false
end
- return false if basesystem.current == FINAL_STEP
+ return false if basesystem.current.upcase == FINAL_STEP
- session[:wizard_mode] = "true"
+ session[:wizard_mode] = basesystem.current
redirect_to :controller => basesystem.current
return true
end
diff --git a/webclient/app/views/layouts/main.rhtml b/webclient/app/views/layouts/main.rhtml
index af91806..fd0d55a 100644
--- a/webclient/app/views/layouts/main.rhtml
+++ b/webclient/app/views/layouts/main.rhtml
@@ -79,7 +79,12 @@
</div>
<div id="footer" class="">
+ <%- if session[:wizard_mode] -%>
+ <span> Wizard mode </span>
+ <%= button_to "Next", :controller => "controlpanel", :action => "nextstep" %>
+ <% end -%>
<div class="copy">© 2009 Novell, Inc.</div>
+
</div>
</body>
</html>
diff --git a/webclient/start.sh b/webclient/start.sh
index 9816294..c5a1846 100755
--- a/webclient/start.sh
+++ b/webclient/start.sh
@@ -1,4 +1,4 @@
#!/bin/sh
rm -f log/development.log
rake db:migrate
-ruby script/server
+ruby script/server --debugger
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org