fix all problem

This commit is contained in:
BOHUNG 2019-12-10 19:33:28 +08:00
parent f5af46731e
commit 1e41d84353
7 changed files with 186 additions and 47 deletions

View File

@ -162,6 +162,7 @@ $(document).ready(function(){
$('.num_only').val('');
$('#cancer_table .cancer_form_field').removeClass('cancertable_empty');
$('#cancer_predict_result_block').css('display','none');
$('#danger_texts').remove();
});
$('#cancer_table_submit').click(function(){
var flag;
@ -227,7 +228,9 @@ $(document).ready(function(){
for(var i = 0;i < $('#result_text_content .cancer_years').length;i++){
$('#result_text_content .cancer_years').eq(i).attr('index',i)
};
$('#result_text_content .cancer_years').off('click').on('click',function(){
$('#current_year').off('change');
$('#result_text_content .cancer_years').off('click')
$('#result_text_content .cancer_years').click(function(){
try{
$(this).parent().find('.cancer_years').removeClass('active');
//$('#result_table_content .cancer_years').eq($(this).attr('index')).click();
@ -250,7 +253,7 @@ $(document).ready(function(){
};
var treatmeny_method = result.responseJSON.treatmeny_method;
$('tr.'+treatmeny_method[0]).addClass('tr_show')
var lpv = [0,-0.8397,-0.4147,-0.3203,0.3321];
var lpv = [0,-0.8397,-0.4147,-0.3203,-0.4687];
var servive_ratio_arr = [result.responseJSON.servive_ratio]
var yes = (I18n.locale=="zh_tw") ? "是" : "yes";
var year = $('#current_year').attr('value');
@ -283,6 +286,7 @@ $(document).ready(function(){
for(var i = 0;i<add_choices.length;i++){
add_choices_transform.push($('[for="'+add_choices[i]+'"]').html())
};
console.log(add_choices_transform);
var add_choices_str = add_choices_transform.slice(0,add_choices_transform.length-1).join('、');
if(add_choices_transform.length >= 2)
add_choices_str += ('以及'+add_choices_transform[add_choices_transform.length-1])
@ -303,7 +307,8 @@ $(document).ready(function(){
for(var i = index + 1;i < this.length; i++){
lpv_real[i] -= lpv_dict[arguments[0]];
var servive_ratio = Math.round((Math.exp(lpv_calc[year])**Math.exp(lpv_real[i]))*100);
var benefit = servive_ratio - servive_ratio_arr[servive_ratio_arr.length - 1];
servive_ratio_arr[i] = servive_ratio;
var benefit = servive_ratio - ((i == index+1) ? servive_ratio_arr[index - 1] : servive_ratio_arr[i - 1]);
$('tr.'+active_treatment[i]+' td.Overall_Survival').html(servive_ratio+'%');
$('.'+active_treatment[i]+'.Overall_Survival').html(servive_ratio);
$('tr.'+active_treatment[i]+' td.Additional_Benefit').html(benefit+'%');
@ -344,18 +349,51 @@ $(document).ready(function(){
};
for(var i = 0;i<treatmeny_method.length;i++){
lpv_dict[treatmeny_method[i]] = lpv[i];
var click_flag=false;
$('#'+treatmeny_method[i]+' .cancer_table_btn').eq(1).off('click');
$('#'+treatmeny_method[i]+' .cancer_table_btn').eq(1).click(function(){
if(!active_treatment.includes($(this).parent().attr('id'))){
active_treatment.push($(this).parent().attr('id'))
console.log(active_treatment);
console.log(servive_ratio_arr);
};
var index = $(this).index()/2;
try{
$(this).parent().find('>input').attr('value',0);
$(this).parent().find('>input').eq(index).attr('value',1);
$(this).parent().find('>button').removeClass('active');
$(this).parent().removeClass('cancertable_empty');
if($('.cancertable_empty').length == 0){
$('#danger_texts').remove();
};
}catch{};
$(this).addClass('active');
if(!click_flag){
if(!active_treatment.includes($(this).parent().attr('id'))){
click_flag = true;
active_treatment.push($(this).parent().attr('id'));
console.log(active_treatment);
console.log(servive_ratio_arr);
click_flag = false;
};
}
});
$('#'+treatmeny_method[i]+' .cancer_table_btn').eq(0).off('click');
$('#'+treatmeny_method[i]+' .cancer_table_btn').eq(0).click(function(){
if(active_treatment.includes($(this).parent().attr('id'))){
active_treatment = active_treatment.remove_item_from_array($(this).parent().attr('id'));
console.log(active_treatment);
console.log(servive_ratio_arr);
var index = $(this).index()/2;
try{
$(this).parent().find('>input').attr('value',0);
$(this).parent().find('>input').eq(index).attr('value',1);
$(this).parent().find('>button').removeClass('active');
$(this).parent().removeClass('cancertable_empty');
if($('.cancertable_empty').length == 0){
$('#danger_texts').remove();
};
}catch{};
$(this).addClass('active');
if(!click_flag){
if(active_treatment.includes($(this).parent().attr('id'))){
click_flag = true;
active_treatment = active_treatment.remove_item_from_array($(this).parent().attr('id'));
console.log(active_treatment);
console.log(servive_ratio_arr);
click_flag = false;
};
};
});
};
@ -398,20 +436,45 @@ $(document).ready(function(){
$('.result_content[index="'+index+'"]').css('display','block');
})
$('.num_only').keypress(function(event){
return event.keyCode>=48&&event.keyCode<=57||(this.value.indexOf('.')<0?event.keyCode==46:false);
});
$('.num_only').blur(function(){
if( Number($(this).val()) < $(this).data('range')[0]){
$('.float_num').off('keyup').on('keyup',function(){
console.log($(this).val());
this.value = this.value.replace(/[^\d.]/g,'');
});
$('.num_only').on('input', function() {
if( Number($(this).val()) < $(this).data('range')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range')[1] && $(this).data('range')[1] != undefined) ){
$(this).css('color','#f24a69');
$(this).addClass('cancertable_empty');
console.log($(this).val())
}else{
$(this).css('color','#333');
$(this).removeClass('cancertable_empty');
if($('.cancertable_empty').length == 0){
$('#danger_texts').remove();
};
}
})
};
});
$('.num_only').blur(function() {
if( Number($(this).val()) < $(this).data('range')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range')[1] && $(this).data('range')[1] != undefined) ){
$(this).css('color','#f24a69');
$(this).addClass('cancertable_empty');
}else{
$(this).css('color','#333');
$(this).removeClass('cancertable_empty');
if($('.cancertable_empty').length == 0){
$('#danger_texts').remove();
};
};
});
$('select.select_num').off('click').on('click',function(){
$(this).change();
});
$('select.select_num').change(function(){
$(this).parent('form').find('>input.num_only').val($(this).val());
$(this).parent().find('>input.num_only').css('color','#333');
$(this).parent().find('>input.num_only').removeClass('cancertable_empty');
if($('.cancertable_empty').length == 0){
$('#danger_texts').remove();
};
});
});

View File

@ -4,7 +4,7 @@
.cencer_table_name{
display: inline-block;
vertical-align: middle;
width: 6.25em;
width: 8.25em;
color:#5d7ca2;
}
.cancer_table_btn{
@ -19,6 +19,18 @@
#cancer_table{
font-size:0.825em;
}
form.for_num{
position: relative;
float:left;
}
select.select_num{
position: absolute;
width:4.125em;
height:1.75em;
left:1em;
clip: rect(0.25em,3.8em,1.5em,2.875em);
border:none;
}
input.num_only{
color: black;
border-top: 0.125em solid rgb(221, 221, 221);
@ -29,6 +41,11 @@ input.num_only{
font-size: 0.875em;
background-color: rgb(255, 255, 255);
height: 2.25em;
position: absolute;
left:0.625em;
}
input.float_num{
position: relative;
}
#cancer_table_left{
float:left;
@ -93,9 +110,9 @@ input.num_only{
border-color: #8c8c8c;
}
.cancertable_empty{
border: 3px solid pink !important;
border-radius: 5px !important;
padding: 2px !important;
border: 0.25em solid pink !important;
border-radius: 0.5em !important;
padding: 0.125em !important;
}
.result_title{
background-color: rgb(210, 105, 0);
@ -176,6 +193,7 @@ input.num_only{
}
.result_content p{
color: #5d7ca2;
clear: both;
}
.cancer_years{
float:left;
@ -251,3 +269,11 @@ div.texts_show{
#cancer_table_left_result .cancer_table_btn{
padding: 0.25em 1em;
}
.modal-dialog {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%) !important;
overflow: auto;
overflow-y: auto;
}

View File

@ -126,7 +126,18 @@ class CancerpredictsController < ApplicationController
@table_str_left += '<div style="margin-right: 2.125em;"></div>'
end
if @field_property["is_num"] == 1
@table_str_left += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/><button class="btn-sub"></button><button class="btn-add"></button>'
if @field_property["is_float"] == 1
@table_str_left += '<input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/>'
else
@table_str_left += '<form class="for_num">'
@table_str_left += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
@please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
@table_str_left += '<select class="select_num"><option value="">'+@please_choice+'</option>'
for @num in @field_property["range"][0] .. @field_property["range"][1]
@table_str_left += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
end
@table_str_left += '</select></form>'
end
else
@table_str_left += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
@field_property["choice_fields"].each do |create_choice|
@ -152,7 +163,18 @@ class CancerpredictsController < ApplicationController
@table_str_right += '<div style="margin-right: 2.125em;"></div>'
end
if @field_property["is_num"] == 1
@table_str_right += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/><button class="btn-sub"></button><button class="btn-add"></button>'
if @field_property["is_float"] == 1
@table_str_right += '<input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><button class="btn-sub"></button><button class="btn-add"></button>'
else
@table_str_right += '<form class="for_num">'
@table_str_right += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
@please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
@table_str_right += '<select class="select_num"><option value="">'+@please_choice+'</option>'
for @num in @field_property["range"][0] .. @field_property["range"][1]
@table_str_right += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
end
@table_str_right += '</select></form>'
end
else
@table_str_right += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
@field_property["choice_fields"].each do |create_choice|
@ -209,7 +231,18 @@ class CancerpredictsController < ApplicationController
@table_result_choice_fileds += '<div style="margin-right: 2.125em;"></div>'
end
if @field_property["is_num"] == 1
@table_result_choice_fileds += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"></input><button class="btn-sub"></button><button class="btn-add"></button>'
if @field_property["is_float"] == 1
@table_result_choice_fileds += '<input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><button class="btn-sub"></button><button class="btn-add"></button>'
else
@table_result_choice_fileds += '<form class="for_num">'
@table_result_choice_fileds += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/><button class="btn-sub"></button><button class="btn-add"></button>'
@please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
@table_result_choice_fileds += '<select class="select_num"><option value="">'+@please_choice+'</option>'
for @num in @field_property["range"][0] .. @field_property["range"][1]
@table_result_choice_fileds += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
end
@table_result_choice_fileds += '</select></form>'
end
else
@table_result_choice_fileds += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
@field_property["choice_fields"].each do |create_choice|

View File

@ -7,21 +7,21 @@ class Cancerpredictfields
include OrbitTag::Taggable
include OrbitCategory::Categorizable
field :title ,type:String ,default:""
field :form_show , :type=> Hash ,default:{0=>{:variable=>"age",:name=>{"zh_tw"=>"年齡","en"=>"age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>''} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[18,93],:right=>0},
1=>{:variable=>"size",:name=>{"zh_tw"=>"腫瘤大小","en"=>"tumor size"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若有多個原發腫瘤,請輸入最大尺寸之原發腫瘤','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[1],:right=>0},
2=>{:variable=>"ratio",:name=>{"zh_tw"=>"淋巴結陽性比例","en"=>"node-positive ratio"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[0,1],:right=>0},
3=>{:variable=>"grade",:name=>{"zh_tw"=>"腫瘤級數","en"=>"tumor grade"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'腫瘤級數代表腫瘤組織與正常組織間的分化程度,若無分化級數資訊,請選擇“未知”選項,將以級數 1 進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','未知'],"en"=>['1','2','3','unknown']},:range=>[],:right=>0},
4=>{:variable=>"subtype",:name=>{"zh_tw"=>"乳癌分型","en"=>"breast cancer subtype"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無分型資訊,請選擇“未知”選項,將以佔多數比例的管腔類進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['分管腔類','人類第二型表皮接受體','三陰型','未知'],"en"=>['Luminal-like','HER2','Triple negative','unknown']},:range=>[],:right=>1},
5=>{:variable=>"pstage",:name=>{"zh_tw"=>"病理分期","en"=>"pathologic stage"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無分期資訊,請選擇“未知”選項,將以病理分期第 1 期進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','4','未知'],"en"=>['1','2','3','4','unknown']},:range=>[],:right=>1},
6=>{:variable=>"lvi",:name=>{"zh_tw"=>"淋巴管或血管侵犯","en"=>"lymph vessel or vascular invasion, LVI"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無淋巴管或血管侵犯資訊,請選擇“未知”選項,將以佔多數比例的淋巴管或血管未侵犯進行預測','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1}
field :form_show , :type=> Hash ,default:{0=>{:variable=>"age",:name=>{"zh_tw"=>"年齡<br/>(age)","en"=>"age"},:is_num=>1, :hint=>{'zh_tw'=>'從 18 歲(含)開始至 93 歲','en'=>''} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[18,93],:right=>0,:is_float=>0},
1=>{:variable=>"size",:name=>{"zh_tw"=>"腫瘤大小<br/>(tumor size)","en"=>"tumor size"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若有多個原發腫瘤,請輸入最大尺寸之原發腫瘤','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[1,300],:right=>0,:is_float=>0},
2=>{:variable=>"ratio",:name=>{"zh_tw"=>"淋巴結陽性比例<br/>(node-positive ratio)","en"=>"node-positive ratio"},:is_num=>1,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>[],"en"=>[]},:range=>[0,1],:right=>0,:is_float=>1},
3=>{:variable=>"grade",:name=>{"zh_tw"=>"腫瘤級數<br/>(tumor grade)","en"=>"tumor grade"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'腫瘤級數代表腫瘤組織與正常組織間的分化程度,若無分化級數資訊,請選擇“未知”選項,將以級數 1 進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','未知'],"en"=>['1','2','3','unknown']},:range=>[],:right=>0,:is_float=>0},
4=>{:variable=>"subtype",:name=>{"zh_tw"=>"乳癌分型<br/>(breast cancer subtype)","en"=>"breast cancer subtype"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'<p>HER2第二型人類上皮成長因子接受器蛋白(HER2-enriched)過度表現型</p><p>若無分型資訊,請選擇“未知”選項,將以佔多數比例的管腔類進行預測。</p>','en'=>''}, :choice_fields=> {"zh_tw"=>['管腔類','HER2','三陰性','未知'],"en"=>['Luminal-like','HER2','Triple negative','unknown']},:range=>[],:right=>1,:is_float=>0},
5=>{:variable=>"pstage",:name=>{"zh_tw"=>"病理分期<br/>(pathologic stage)","en"=>"pathologic stage"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無分期資訊,請選擇“未知”選項,將以病理分期第 1 期進行預測。','en'=>''}, :choice_fields=> {"zh_tw"=>['1','2','3','4','未知'],"en"=>['1','2','3','4','unknown']},:range=>[],:right=>1,:is_float=>0},
6=>{:variable=>"lvi",:name=>{"zh_tw"=>"淋巴管或血管侵犯<br/>(lymph vessel or vascular invasion, LVI)","en"=>"lymph vessel or vascular invasion, LVI"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'若無淋巴管或血管侵犯資訊,請選擇“未知”選項,將以佔多數比例的淋巴管或血管未侵犯進行預測','en'=>''}, :choice_fields=> {"zh_tw"=>['是','否','未知'],"en"=>['yes','no','unknown']},:range=>[],:right=>1,: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'=>'賀爾蒙治療適用於ER狀態為陽性之病人','en'=>'Hormone (endocrine) therapy is available when ER-status is positive'} , :comment_text=>{'zh_tw'=>'年齡為該婦女於確診罹患乳癌時之年齡','en'=>'<p>Hormone therapy, or endocrine therapy, involves a woman taking drugs to prevent the growth of tumour cells that are boosted by the hormone oestrogen. Drugs of this kind include tamoxifen (brand names include Nolvadex, Istabul, Valodex, and Soltamox) and aromatase inhibitors such as anastrozole, exemestane, and letrozole (brand names Arimidex, Aromasin, and Femara).</p>'+
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'=>'賀爾蒙治療適用於ER狀態為陽性之病人','en'=>'Hormone (endocrine) therapy is available when ER-status is positive'} , :comment_text=>{'zh_tw'=>'','en'=>'<p>Hormone therapy, or endocrine therapy, involves a woman taking drugs to prevent the growth of tumour cells that are boosted by the hormone oestrogen. Drugs of this kind include tamoxifen (brand names include Nolvadex, Istabul, Valodex, and Soltamox) and aromatase inhibitors such as anastrozole, exemestane, and letrozole (brand names Arimidex, Aromasin, and Femara).</p>'+
'<p>Some hormone therapy drugs act by blocking the action of oestrogen on the cells and some work by lowering the amount of oestrogen in the body (NB hormone therapy for breast cancer is the opposite of hormone replacement therapy or HRT, which is taken by women to help INCREASE oestrogen levels to help deal with side-effects of the menopause).</p>'+
'<p>Treatments usually have the potential to cause harm as well as benefit. It is important to weigh up the risks of potential harm against the potential benefits of treatment in order to reach a decision. Some may cause more harm than benefit to some people.</p>'+
'<p>It is useful to switch between 1 and 5 years hormone therapy to compare the survival outcomes.</p>'}, :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=>[]},
2=>{:variable=>"Radiotherapy",:name=>{"zh_tw"=>"放射治療","en"=>"Radiotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'放射治療','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},
3=>{:variable=>"Targeted_therapy",:name=>{"zh_tw"=>"標靶治療","en"=>"Targeted therapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :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=>[]},
2=>{:variable=>"Radiotherapy",:name=>{"zh_tw"=>"放射治療","en"=>"Radiotherapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]},
3=>{:variable=>"Targeted_therapy",:name=>{"zh_tw"=>"標靶治療","en"=>"Targeted therapy"},:is_num=>0,:hint=>{'zh_tw'=>'','en'=>''}, :comment_text=>{'zh_tw'=>'','en'=>''}, :choice_fields=> {"zh_tw"=>['否','是'],"en"=>['No','Yes']},:range=>[]}
}
field :form_result_is_right , :type=> Integer ,default: 1
# before_destroy :destroy_email

View File

@ -12,16 +12,6 @@ all_template.each do |folder|
end
end
end
filedata = File.read(ENV['PWD']+"/config/routes.rb")
exist_str = ['get "cancerpredictResult",to: "cancerpredicts#calculate"','post "cancerpredictResult",to: "cancerpredicts#calculate"']
exist_str.each do |str|
if !filedata.include? str
@file = ENV['PWD']+"/config/routes.rb"
open(@file, 'a') { |f|
f.puts exist_str
}
end
end
# Maintain your gem's version:
require "cancerpredict/version"
# Describe your gem and declare its dependencies:

27
modules/_head.html.erb Normal file
View File

@ -0,0 +1,27 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%= favicon_link_tag (current_site.favicon.blank? ? 'favicon.ico' : current_site.favicon.url) %>
<title><%= render_site_title %></title>
<%= stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"%>
<%= stylesheet_link_tag "bootstrap/bootstrap.min.css"%>
<%= stylesheet_link_tag "template/template"%>
<link rel="stylesheet" media="print" type="text/css" href="/assets/template/print.css">
<%= javascript_include_tag "plugin/modernizr.js"%>
<%= javascript_include_tag "plugin/picturefill.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"%>
<%= javascript_include_tag "plugin/jquery.mobile.custom.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.carousel.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.scrollVert.min.js"%>
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.tile.min.js"%>
<%= javascript_include_tag "plugin/jquery.cycle2.video.min.js"%>
<%= javascript_include_tag "plugin/jquery-bullseye-min.js"%>
<%= javascript_include_tag "app"%>
<%= javascript_include_tag "#{@dataApi}" if @dataApi != nil%>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<%= render_google_analytics %>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

View File

@ -23,4 +23,4 @@ gem "breadcrumb_widget", git: "http://gitlab.tp.rulingcom.com/saurabh/breadcrumb
gem "announcement_link_widget", git: "http://gitlab.tp.rulingcom.com/harry/announcement-link-widget.git"
gem 'patchfile', git: 'http://gitlab.tp.rulingcom.com/chiu/patch_file.git'
gem 'cancerpredict', git: 'http://gitlab.tp.rulingcom.com/chiu/cancer_predict.git'
gem 'cancerpredict', branch: 'final_version' , git: 'http://gitlab.tp.rulingcom.com/chiu/cancer_predict.git'