[yast-commit] <web-client> backgroud_patches_bnc550934 : adapt frontend to time sending utc status as boolean
ref: refs/heads/backgroud_patches_bnc550934 commit d271b980452226633e98335adf9ad571488a43d4 Author: Josef Reidinger <jreidinger@suse.cz> Date: Fri Dec 18 13:52:18 2009 +0100 adapt frontend to time sending utc status as boolean --- .../systemtime/app/views/systemtime/index.rhtml | 4 +++- plugins/systemtime/lib/systemtime.rb | 1 + .../test/functional/systemtime_controller_test.rb | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/systemtime/app/views/systemtime/index.rhtml b/plugins/systemtime/app/views/systemtime/index.rhtml index 04c8d9e..d2aab05 100644 --- a/plugins/systemtime/app/views/systemtime/index.rhtml +++ b/plugins/systemtime/app/views/systemtime/index.rhtml @@ -64,14 +64,16 @@ :disabled => disabled}) %> </span> </p> + <% unless @utcstatus.nil? %> <p> <% #don't use check_box helper as it generate also hidden opposite value %> <input type="checkbox" name="utc" id="utc" value="true" - <%= "checked=\"checked\"" if @utcstatus == "UTC"%> + <%= "checked=\"checked\"" if @utcstatus %> <%= "disabled=\"disabled\"" if disabled %> /> <span class="form-details"><%=_("Hardware clock is set to UTC")%></span> </p> + <% end %> </fieldset> <fieldset> <p> diff --git a/plugins/systemtime/lib/systemtime.rb b/plugins/systemtime/lib/systemtime.rb index fd95c52..9fe22c3 100644 --- a/plugins/systemtime/lib/systemtime.rb +++ b/plugins/systemtime/lib/systemtime.rb @@ -12,4 +12,5 @@ def fill_proxy_with_timezone(proxy,params,timezones) tmz = region.entries.find { |e| e.name == params[:timezone]} proxy.timezone = tmz.id if tmz + proxy.utcstatus = params[:utc] == "true" end diff --git a/plugins/systemtime/test/functional/systemtime_controller_test.rb b/plugins/systemtime/test/functional/systemtime_controller_test.rb index 0af6b97..70e2995 100644 --- a/plugins/systemtime/test/functional/systemtime_controller_test.rb +++ b/plugins/systemtime/test/functional/systemtime_controller_test.rb @@ -59,7 +59,7 @@ class SystemtimeControllerTest < ActionController::TestCase ] @time = "12:18:00" @date = "07/02/2009" - @utcstatus = "localtime" + @utcstatus = false @timezone = "Europe/Prague" end @@ -118,7 +118,7 @@ class SystemtimeControllerTest < ActionController::TestCase assert_redirected_to :controller => "controlpanel", :action => "index" assert @result.saved - assert_equal "localtime",@result.utcstatus + assert_equal false,@result.utcstatus end def test_commit_wizard @@ -131,7 +131,7 @@ class SystemtimeControllerTest < ActionController::TestCase assert_redirected_to :controller => "controlpanel", :action => "nextstep" assert @result.saved - assert_equal "localtime",@result.utcstatus + assert_equal false, @result.utcstatus end def test_ntp_force -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Josef Reidinger