diff --git a/app/controllers/admin/cancerpredicts_controller.rb b/app/controllers/admin/cancerpredicts_controller.rb index df2b65e..a4a6679 100644 --- a/app/controllers/admin/cancerpredicts_controller.rb +++ b/app/controllers/admin/cancerpredicts_controller.rb @@ -267,20 +267,25 @@ class Admin::CancerpredictsController < OrbitAdminController if @field_property["is_float"] == 1 @table_str_left += '
' else - @table_str_left += '
' - @table_str_left += '' - @table_str_left += '' - @please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice" - @table_str_left += '
' + else + @table_str_left += '
' + @table_str_left += '' + @table_str_left += '' + + @please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice" + @table_str_left += '
' end - for @num in @field_property["range"][0] .. @field_property["range"][1] - @table_str_left += ('') - end - @table_str_left += '' end else @table_str_left += '
' diff --git a/app/models/cancerpredictfields.rb b/app/models/cancerpredictfields.rb index 3cfdc7b..b25711b 100644 --- a/app/models/cancerpredictfields.rb +++ b/app/models/cancerpredictfields.rb @@ -7,9 +7,9 @@ class Cancerpredictfields include OrbitTag::Taggable include OrbitCategory::Categorizable field :title ,type:String ,default:"" - field :form_show , :type=> Hash ,default:{0=>{:variable=>"sex",:name=>{"zh_tw"=>"性別
(Sex)","en"=>"Sex"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>'Age must be between 18 and 93'} , :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['男','女'],"en"=>['Male','Female']},:range=>[],:right=>0,:is_float=>0}, - 1=>{:variable=>"age",:name=>{"zh_tw"=>"年齡
(Age)","en"=>"Age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>'Age must be between 18 and 93'} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>'Age at diagnosis'}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[],:right=>0,:is_float=>0}, - 2=>{:variable=>"calcification_score",:name=>{"zh_tw"=>"鈣化指數
(Calcification score)","en"=>"Calcification score"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[],:right=>0,:is_float=>0}, + field :form_show , :type=> Hash ,default:{0=>{:variable=>"sex",:name=>{"zh_tw"=>"性別
(Sex)","en"=>"Sex"},:is_num=>0, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>'Age must be between 18 and 93'} , :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['男','女'],"en"=>['Male','Female']},:range=>[],:right=>0,:is_float=>0}, + 1=>{:variable=>"age",:name=>{"zh_tw"=>"年齡
(Age)","en"=>"Age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>'Age must be between 18 and 93'} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>'Age at diagnosis'}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[18.93],:right=>0,:is_float=>0}, + 2=>{:variable=>"calcification_score",:name=>{"zh_tw"=>"鈣化指數
(Calcification score)","en"=>"Calcification score"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[],:right=>0,:is_float=>0} } field :form_show_in_result , :type=> Hash ,default:{0=>{:variable=>"hormone_therapy",:name=>{"zh_tw"=>"賀爾蒙治療","en"=>"Hormone/Steroid therapy"},:is_num=>0, :hint=>{'zh_tw'=>'適用賀爾蒙受體陽性病人','en'=>'Hormone/ steroid therapy is available when ER status is positive'} , :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}, 1=>{:variable=>"Chemotherapy",:name=>{"zh_tw"=>"化學治療","en"=>"Chemotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},