From 3353d1595bda539dbc4daabcc8031b7a814ba4cf Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Wed, 27 Nov 2019 21:24:09 +0800 Subject: [PATCH] add create the cancer_predict_tool_table --- app/controllers/cancerpredicts_controller.rb | 79 +++++++++++++------ .../_cancer_predict_widget.html.erb | 55 +++++++------ .../cancer_predict_index.html.erb | 51 ++++++------ 3 files changed, 109 insertions(+), 76 deletions(-) diff --git a/app/controllers/cancerpredicts_controller.rb b/app/controllers/cancerpredicts_controller.rb index cecbdd3..776baf5 100644 --- a/app/controllers/cancerpredicts_controller.rb +++ b/app/controllers/cancerpredicts_controller.rb @@ -12,9 +12,10 @@ class CancerpredictsController < ApplicationController categories = OrbitHelper.widget_categories || [] locale = OrbitHelper.get_site_locale.to_s @table_str = '
' + @table_left_str = '
' + @table_right_str = '
' create_first_field - @form_to_show.form_show.each do |num,property| - @table_str += '
' + @form_to_show.form_show.each do |num,property| @field_property = {} property.each do |key,value| @value= value @@ -25,31 +26,61 @@ class CancerpredictsController < ApplicationController end @field_property[key] = @disp_value end - break if @field_property["name"] == "" - @table_str += '' - if @field_property["comment_text"] != "" - @table_str += '' - @table_str += '' - else - @table_str += '
' - end - if @field_property["is_num"] == 1 - @table_str += '' - else - @table_str += '
' - @field_property["choice_fields"].each do |create_choice| - @table_str += '' - @table_str += '' + if @field_property['right'] == 0 + @table_str_left += '
' + break if @field_property["name"] == "" + @table_str_left += '' + if @field_property["comment_text"] != "" + @table_str_left += '' + @table_str_left += '' + else + @table_str_left += '
' end - @table_str += '' + if @field_property["is_num"] == 1 + @table_str_left += '' + else + @table_str_left += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_left += '' + @table_str_left += '' + end + end + if @field_property["hint"].to_s != "" + @table_str_left +='
'+@field_property["hint"]+'
' + end + @table_str_left += '
' + @table_str_left += '
' + else + @table_str_right += '
' + break if @field_property["name"] == "" + @table_str_right += '' + if @field_property["comment_text"] != "" + @table_str_right += '' + @table_str_right += '' + else + @table_str_right += '
' + end + if @field_property["is_num"] == 1 + @table_str_right += '' + else + @table_str_right += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_right += '' + @table_str_right += '' + end + end + if @field_property["hint"].to_s != "" + @table_str_right +='
'+@field_property["hint"]+'
' + end + @table_str_right += '
' + @table_str_right += '
' end - if @field_property["hint"].to_s != "" - @table_str +='
'+@field_property["hint"]+'
' - end - @table_str += '
' end + @table_str+= (@table_str_right+@table_str_right) @table_str+='
' { "cancerpredict" => [], diff --git a/modules/cancerpredict/_cancer_predict_widget.html.erb b/modules/cancerpredict/_cancer_predict_widget.html.erb index 9de2038..dfe4b0a 100644 --- a/modules/cancerpredict/_cancer_predict_widget.html.erb +++ b/modules/cancerpredict/_cancer_predict_widget.html.erb @@ -1,32 +1,31 @@ -
- <%= javascript_include_tag "react.js"%> - - -

- {{widget-title}} -

-
-
-
-
-
-
 
-
Loading...
-
-
-
-
-
-
+ + + +{{table}} \ No newline at end of file diff --git a/modules/cancerpredict/cancer_predict_index.html.erb b/modules/cancerpredict/cancer_predict_index.html.erb index 42c3a96..dfe4b0a 100644 --- a/modules/cancerpredict/cancer_predict_index.html.erb +++ b/modules/cancerpredict/cancer_predict_index.html.erb @@ -1,28 +1,31 @@ -
- - - -

{{page-title}}

-
-
-
-
-
 
-
Loading...
-
-
-
-
-
+ + + +{{table}} \ No newline at end of file