Klaus KXXmpf wrote:
ref: refs/heads/master commit 93073b2d3f55a9ee3a87a3e8b95bf6937a0902f8 Author: Klaus Kämpf
Date: Wed Jul 15 16:43:09 2009 +0200 Add FIXMEs --- .../app/controllers/system_time_controller.rb | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/plugins/systemtime/app/controllers/system_time_controller.rb b/plugins/systemtime/app/controllers/system_time_controller.rb index a2fe83e..2155aa1 100644 --- a/plugins/systemtime/app/controllers/system_time_controller.rb +++ b/plugins/systemtime/app/controllers/system_time_controller.rb @@ -1,6 +1,8 @@ require 'yast/service_resource' require 'systemtime'
+# FIXME: add comments to explain functions +
Hi, I try solve all fixmes before I go on vacation. documentation is done
class SystemTimeController < ApplicationController before_filter :login_required layout 'main' @@ -15,6 +17,7 @@ class SystemTimeController < ApplicationController end
def fill_current_region + # FIXME: @region can remain unset I solve that after discussion with jsuchome where this case can happen and check if rest-service is setted to unknown timezone (only unknown timezone couldn't have region). So if that one is setted I show error. @@timezones.each do |region| region.entries.each do |entry| if entry.id == @systemtime.timezone @@ -25,17 +28,19 @@ class SystemTimeController < ApplicationController end
def fill_date_and_time (timedate) + # FIXME: such conversions should be in a model Done @time = timedate[timedate.index(" - ")+3,8] @date = timedate[0..timedate.index(" - ")-1] #convert date to format for datepicker @date.sub!(/^(\d+)-(\d+)-(\d+)/,'\3/\2/\1') end
- - public + + # FIXME: should go to initialize() done @@timezones = {}
+ # FIXME: should go to initialize()
Doesn't work in initialize, and after googling noone have it in initialize and even in tutorial it is directly in class
# Initialize GetText and Content-Type. init_gettext "yast_webclient_systemtime" # textdomain, options(:charset, :content_type)
@@ -53,9 +58,11 @@ class SystemTimeController < ApplicationController fill_date_and_time(@systemtime.time) end
+ # FIXME: rename to 'update' to match rails conventions done def commit_time t = load_proxy 'org.opensuse.yast.modules.yapi.time'
+ # FIXME: add a 'redirect_to' all these redirect to stuff is problematic as in load_proxy is some redirect_to if occur situation where we can redirect to adress with howto solve problem. I try change load_proxy to redirect in each case where it make sense and document how to cancel redirection if anyone need it (like AJAX stuff). unless t return false end @@ -71,14 +78,17 @@ class SystemTimeController < ApplicationController rescue ActiveResource::ClientError => e flash[:error] = YaST::ServiceResource.error(e) log_exception e + #FIXME: what about other exceptions ? done end
redirect_to :action => :index end
+ # FIXME: rename to 'update' to match rails conventions done def commit_timezone t = load_proxy 'org.opensuse.yast.modules.yapi.time'
+ # FIXME: add a 'redirect_to' ^^^ unless t return false end @@ -91,6 +101,7 @@ class SystemTimeController < ApplicationController rescue ActiveResource::ClientError => e flash[:error] = YaST::ServiceResource.error(e) log_exception e + #FIXME: what about other exceptions ? done end
redirect_to :action => :index
-- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast modules language and time -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org