commit 0cf4dafdd2e40f3587261206a6b55edb01fa12f4 Author: 邱博亞 Date: Fri Aug 23 21:33:48 2024 +0800 First version. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de5d954 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/db/*.sqlite3-journal +test/dummy/log/*.log +test/dummy/tmp/ +test/dummy/.sass-cache diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..d15019e --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +# Declare your gem's dependencies in bulletin.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use debugger +# gem 'debugger' diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..7c10c1f --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2019 YOURNAME + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..f3fd45f --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += HncCancerPredict + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..1346771 --- /dev/null +++ b/Rakefile @@ -0,0 +1,32 @@ +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end + +require 'rdoc/task' + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'hnc_cancer_predict' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + + + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task default: :test diff --git a/app/assets/images/hnc_cancer_predict/.keep b/app/assets/images/hnc_cancer_predict/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/hnc_cancer_predict/triangle_add.png b/app/assets/images/hnc_cancer_predict/triangle_add.png new file mode 100644 index 0000000..086202d Binary files /dev/null and b/app/assets/images/hnc_cancer_predict/triangle_add.png differ diff --git a/app/assets/images/hnc_cancer_predict/triangle_sub.png b/app/assets/images/hnc_cancer_predict/triangle_sub.png new file mode 100644 index 0000000..c6ae87c Binary files /dev/null and b/app/assets/images/hnc_cancer_predict/triangle_sub.png differ diff --git a/app/assets/javascripts/admin/hnc_cancer_predict.js b/app/assets/javascripts/admin/hnc_cancer_predict.js new file mode 100644 index 0000000..dee720f --- /dev/null +++ b/app/assets/javascripts/admin/hnc_cancer_predict.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/hnc_cancer_predict-95e398d9a8575562c0ab57e7d2bd25cdcf0bbef622103c4cce19d0705717ded3.js b/app/assets/javascripts/hnc_cancer_predict-95e398d9a8575562c0ab57e7d2bd25cdcf0bbef622103c4cce19d0705717ded3.js new file mode 100644 index 0000000..53a75f7 --- /dev/null +++ b/app/assets/javascripts/hnc_cancer_predict-95e398d9a8575562c0ab57e7d2bd25cdcf0bbef622103c4cce19d0705717ded3.js @@ -0,0 +1,856 @@ +Array.prototype.get_nearest_value = function(goal){ + var nearest_value = this.reduce(function(prev, curr) { + return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev); + }); + return nearest_value; +} +function change_object_variables(obj1,obj2,operator="-",target="new"){ + var obj_new = {}; + var obj_keys = Object.keys(obj1); + obj_keys.forEach(function(k){ + if(obj2[k] == undefined){ + if( target == "new"){ + obj_new[k] = obj1[k]; + } + }else{ + if(operator == "-"){ + if( target == "new"){ + obj_new[k] = obj1[k] - obj2[k]; + }else{ + obj1[k] = obj1[k] - obj2[k]; + } + }else if(operator == "+"){ + if( target == "new"){ + obj_new[k] = obj1[k] + obj2[k]; + }else{ + obj1[k] = obj1[k] + obj2[k]; + } + } + } + }) + if( target == "new"){ + return obj_new; + }else{ + return obj1; + } +} +$(document).ready(function(){ + var head_data = $.post("/hnc_cancer_predictResult",{"header":1,locale:I18n.locale}); + var data = {}; + if(I18n.locale == 'en'){ + var window_width = $(window).width(); + if(window_width < 520){ + $('#cancer_table .cencer_table_name').css('max-width',''); + }else if(window_width < 768){ + $('#cancer_table .cencer_table_name').css({'max-width':'','width':'11em'}); + }else if(window_width < 860){ + $('#cancer_table .cencer_table_name').css('max-width','30%'); + }else if(window_width < 1130){ + $('#cancer_table .cencer_table_name').css('max-width','33%'); + }else{ + $('#cancer_table .cencer_table_name').css('max-width','39%'); + }; + }; + function round(num,Digit=0){ + return Math.round(Number(num)*(10**Digit))/(10**Digit); + }; + head_data.done(function(){ + if(head_data.responseJSON['hnc_head_images'] != ''){ + $('.header-nav').html(head_data.responseJSON['hnc_head_images']); + } + if(head_data.responseJSON['title'] != ''){ + $('.navbar-brand').html(head_data.responseJSON['title']); + } + data['danger_texts'] = head_data.responseJSON['danger_texts']; + $('head title').text(head_data.responseJSON['page_title']) + }); + var mapping_data = $.post("/hnc_cancer_predictResult",{"get_mapping_data_from_csv":1,locale:I18n.locale}); + mapping_data.done(function(){ + // $('.header-nav').html(hnc_head_images.responseJSON['hnc_head_images']); + // $('.navbar-brand').html(hnc_head_images.responseJSON['title']) + window.mapping_data_from_csv = mapping_data.responseJSON['mapping_data_from_csv']; + }); + Array.prototype.remove_item_from_array = function(){ + var result_array = this; + for(var i=0;i $(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(); + }; + }; + }); + $('input#lymph_nodes_positive').off('input').on('input',function(){ + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($(this).val()) < $(this).data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range_new')[1] && $(this).data('range_new')[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(); + }; + }; + }); + $('input#lymph_nodes_examined').off('input').on('input',function(){ + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($(this).val()) < $(this).data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range_new')[1] && $(this).data('range_new')[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(); + }; + }; + }); + $('.cancer_help_btn').off("click").on('click',function(){ + var modal_head = ""; + try{ modal_head = $(this).parent().find(">label").html()}catch(e){}; + var modal_body = ""; + try{ modal_body = $(this).parent().find(">input.help_texts").attr('value')}catch(e){}; + $('#show_help_modal').html("") + $('#show_help_modal').modal('show'); + $('#show_help_modal .close').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + $('#show_help_modal .modal-footer button').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + }); + $('.btn-add').click(function(){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[1]; + if(compare_value != undefined){ + if(input_value+1 <= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value+1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value+1); + }; + compare_value = $(this).parent().find('.num_only').data('range')[0]; + if(compare_value != undefined){ + if($(this).parent().find('.num_only').val() >= compare_value){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }else{ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }catch(e){ + $(this).parent().find('.num_only').val(0); + }; + if($(this).parent().find('.num_only').val() != ""){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + }; + }); + $('.btn-sub').click(function(){ + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[0]; + if(compare_value != undefined){ + if(input_value-1 >= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value-1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value-1); + }; + compare_value = $(this).parent().find('.num_only').data('range')[1]; + if(compare_value != undefined){ + if($(this).parent().find('.num_only').val() <= compare_value){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }else{ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined){ + $(this).parent().find('.num_only').val(input_value); + }else{ + input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + } + }catch(e){ + $(this).parent().find('.num_only').val(0); + }; + if($(this).parent().find('.num_only').val() != ""){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }); + $('.cancer_table_btn').off('click').on('click',function(){ + 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(e){}; + $(this).addClass('active'); + }); + $('#cancer_table_reset').click(function(){ + $('.cancer_table_btn').removeClass('active'); + $('.cancer-btn-group input').attr('value',0); + $('.num_only').val(''); + $('.num_only_value').val(''); + $('#cancer_table .cancer_form_field').removeClass('cancertable_empty'); + $('#hnc_cancer_predict_result_block').css('display','none'); + $('#danger_texts').remove(); + $('select.select_num').val(''); + }); + function get_input_data(){ + var flag; + flag = 1; + for(var i = 0;i < $('#cancer_table .cancer_form_field').length;i++){ + if($('#cancer_table .cancer_form_field').eq(i).hasClass('num_only')){ + if($('#cancer_table .cancer_form_field').eq(i).val()==""){ + flag = 0; + $('#cancer_table .cancer_form_field').eq(i).addClass('cancertable_empty'); + }else if($('#cancer_table .cancer_form_field').eq(i).val() != "" && !$('#cancer_table .cancer_form_field').eq(i).hasClass('cancertable_empty')){ + $('#cancer_table .cancer_form_field').eq(i).removeClass('cancertable_empty'); + }; + }else{ + if($('#cancer_table .cancer_form_field').eq(i).find('[value="1"]').length == 0){ + flag = 0; + $('#cancer_table .cancer_form_field').eq(i).addClass('cancertable_empty'); + }else{ + $('#cancer_table .cancer_form_field').eq(i).removeClass('cancertable_empty'); + } + }; + }; + if( Number($('input#lymph_nodes_examined').siblings('.num_only_value').val()) < Number($('input#lymph_nodes_positive').siblings('.num_only_value').val())){ + $('input#lymph_nodes_positive').addClass('cancertable_empty'); + $('input#lymph_nodes_positive').css('color','rgb(242, 74, 105)'); + }; + if($('.cancertable_empty').length != 0){ + flag = 0; + ($('#danger_texts').length == 0) ? $('#cancer_table_submit').parent().before(''+data['danger_texts']+'') : null; + $('#danger_texts').css('margin-left',$(window).width()/2-$('#danger_texts').width()/2); + }else{ + $('#danger_texts').remove(); + }; + if(flag == 1){ + var post_json= {}; + for(var i = 0;i < $('#cancer_table .cancer_form_field').length;i++){ + var name = $('#cancer_table .cancer_form_field').eq(i).attr('id') + if($('#cancer_table .cancer_form_field').eq(i).hasClass('num_only')) + post_json[name] = Number($('#cancer_table .cancer_form_field').eq(i).siblings('.num_only_value').val()); + else{ + var index = ($('#cancer_table .cancer_form_field').eq(i).find('[value="1"]').index()+1)/2; + post_json[name] = index; + }; + }; + if( post_json["ER_status"] == 2 && post_json["PR_status"] == 2 ){ + $('#hormone_therapy .cancer_table_btn').attr('disabled','disabled'); + $('[for="hormone_therapy"]').css('color','rgb(204, 204, 204)'); + }else{ + $('#hormone_therapy .cancer_table_btn').removeAttr('disabled'); + $('[for="hormone_therapy"]').css('color',''); + }; + /*disable_condition start*/ + /*disable_condition end*/ + return post_json; + }else{ + return null; + } + }; + function set_result(result){ + if(result.responseJSON.lpv != "error"){ + $('#choice_fields .cancer_table_btn').removeClass('active'); + var load_heml = $('#result_table_content').html(result.responseJSON.table); + load_heml.ready(function(){ + $('#result_table_content .cancer_years').eq(-1).addClass('active'); + for(var i = 0;i < $('#result_table_content .cancer_years').length;i++){ + $('#result_table_content .cancer_years').eq(i).attr('index',i) + }; + $('#result_table_content .cancer_years').off('click').on('click',function(){ + try{ + $(this).parent().find('.cancer_years').removeClass('active'); + }catch(e){}; + $(this).addClass('active'); + $('#current_year').attr('index',$(this).attr('index')); + $('#current_year').attr('value',$(this).html()); + $('#current_year').change(); + }); + }); + load_heml = $('#result_text_content').html(result.responseJSON.texts); + load_heml.ready(function(){ + $('#result_text_content .cancer_years').eq(-1).addClass('active'); + for(var i = 0;i < $('#result_text_content .cancer_years').length;i++){ + $('#result_text_content .cancer_years').eq(i).attr('index',i) + }; + $('#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'); + }catch(e){}; + $(this).addClass('active'); + $('#current_year').attr('value',$(this).html()); + $('#current_year').attr('index',$(this).attr('index')); + $('.surgery_year').html($(this).html()); + $('#current_year').change(); + }); + $('#cancer_table_right_result .cancer-btn-group .cancer_table_btn').removeClass('active'); + $('#cancer_table_right_result .cancer-btn-group >input').attr('value',"0"); + for(var i = 0;i < $('#cancer_table_left_result .cancer-btn-group').length;i++){ + $('#cancer_table_left_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); + $('#cancer_table_left_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1"); + }; + for(var i = 0;i < $('#cancer_table_right_result .cancer-btn-group').length;i++){ + $('#cancer_table_right_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); + $('#cancer_table_right_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1"); + }; + var treatment_method = result.responseJSON.treatment_method; + var treatment_method_active_indices = result.responseJSON.treatment_method_active_indices; + $('tr.'+treatment_method[0]).addClass('tr_show'); + var servive_ratio_arr = [result.responseJSON.servive_ratio] + var yes = (I18n.locale=="zh_tw") ? "是" : "yes"; + var year = $('#current_year').attr('value'); + var active_treatment = ['Surgery_only']; + $('tr.'+active_treatment[0]+' .Overall_Survival').html(servive_ratio_arr[0]+'%'); + $('span.'+active_treatment[0]+'.Overall_Survival').html(Math.round(servive_ratio_arr[0])); + $('#hnc_cancer_predict_result_block').css('display','block'); + var lpv_real = [result.responseJSON['lpv_variable']]; + var lpv = /*therapy_lpv start*/[0, 0.15613, -0.34129];/*therapy_lpv end*/; + var lpv_dict={}; + var lpv_calc=/*lpv_calc_formula_start*/{"1":"Math.exp(-0.03639284)**( Math.exp(lpv_current) )","3":"Math.exp(-0.08738490)**( Math.exp(lpv_current) )","5":"Math.exp(-0.10683094)**( Math.exp(lpv_current) )"};/*lpv_calc_formula_end*/ + active_treatment.push = function() { + if(arguments.length == 1){ + var year = $('#current_year').attr('value'); + console.log(lpv_real); + console.log(lpv_dict[arguments[0]]) + var lpv_current = change_object_variables(lpv_real[lpv_real.length-1],{"lpv": lpv_dict[arguments[0]]},'+'); + lpv_real.push(lpv_current); + lpv_current = lpv_current['lpv']; + var servive_ratio = round(eval(lpv_calc[year])*100,2); + var benefit = servive_ratio - servive_ratio_arr[servive_ratio_arr.length - 1]; + servive_ratio_arr.push(servive_ratio); + $('tr.'+arguments[0]+' td.Overall_Survival').html(servive_ratio+'%'); + $('tr.'+arguments[0]+' td.Additional_Benefit').html(round(benefit,2)+'%'); + $('tr.'+arguments[0]).css('display','table-row'); + $('tr.tr_show').eq(-1).after($('tr.'+arguments[0])); + $('tr.'+arguments[0]).addClass('tr_show'); + if(this.length == 1){ + $('.addition').css('display','inline-block'); + $('#result_text_content .extra-text').css('display','inline-block'); + } + var add_choices = this.slice(1,this.length); + add_choices.push(arguments[0]); + var add_choices_transform = []; + for(var i = 0;i= 2) + add_choices_str += ((I18n.locale == 'en' ? ', and ': '以及')+add_choices_transform[add_choices_transform.length-1]) + else + add_choices_str = add_choices_transform[0]; + var extra_therapy_texts = result.responseJSON['extra_therapy_texts']; + extra_therapy_texts = extra_therapy_texts.replace('{{extra_therapy}}',''+add_choices_str+''); + extra_therapy_texts = extra_therapy_texts.replace('{{survival_num}}',''+Math.round(servive_ratio)+''); + extra_therapy_texts = extra_therapy_texts.replace('{{surgery_year}}',''+year+''); + extra_therapy_texts = extra_therapy_texts.replace('{{Additional_Benefit}}',''+Math.round(benefit)+''); + var new_text = '

'; + new_text += (extra_therapy_texts+'

'); + $('#result_text_content .extra-text .texts_show').eq(-1).after(new_text) + return Array.prototype.push.apply(this, arguments); + }else{ + return Array.prototype.push.apply(this, arguments); + } + }; + active_treatment.remove_item_from_array = function(){ + if(arguments.length == 1 && !Array.isArray(arguments[0])){ + var index = this.indexOf(arguments[0]) + var year = $('#current_year').attr('value'); + if(index < this.length - 1){ + for(var i = index + 1;i < this.length; i++){ + change_object_variables(lpv_real[i] , {"lpv": lpv_dict[arguments[0]]} , '-' , 'self'); + var lpv_current = lpv_real[i]; + lpv_current = lpv_current['lpv']; + var servive_ratio = round(eval(lpv_calc[year])*100,2); + 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(Math.round(servive_ratio)); + $('tr.'+active_treatment[i]+' td.Additional_Benefit').html(round(benefit,2)+'%'); + $('.'+active_treatment[i]+'.Additional_Benefit').html(Math.round(benefit)); + }; + var add_choices = []; + for(var i = 1;i < this.length; i++){ + if(i != index){ + add_choices.push(this[i]); + var add_choices_transform = []; + for(var j = 0;j= 2) + add_choices_str += ((I18n.locale == 'en' ? ', and ': '以及')+add_choices_transform[add_choices_transform.length-1]) + else + add_choices_str = add_choices_transform[0]; + $('.'+active_treatment[i]+'.choices').html(add_choices_str); + } + }; + }; + $('tr.'+arguments[0]+' td.Overall_Survival').html('-'); + $('tr.'+arguments[0]+' td.Additional_Benefit').html('-'); + $('tr.'+arguments[0]).css('display','none'); + $('tr.'+arguments[0]).removeClass('tr_show'); + $('span.'+arguments[0]).eq(0).parent().remove(); + lpv_real = lpv_real.remove_item_from_array(lpv_real[index]); + servive_ratio_arr = servive_ratio_arr.remove_item_from_array(servive_ratio_arr[index]); + if(this.length == 2){ + $('.addition').css('display','none'); + $('#result_text_content .extra-text').css('display','none'); + }; + return Array.prototype.remove_item_from_array.apply(this, arguments); + }else{ + return Array.prototype.remove_item_from_array.apply(this, arguments); + }; + }; + for(var i = 0;iinput').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(e){}; + $(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')); + click_flag = false; + }; + }; + }); + $('#'+treatment_method[i]+' .cancer_table_btn').eq(treatment_method_active_indices[i]).off('click').click(function(){ + 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(e){}; + $(this).addClass('active'); + if(!click_flag){ + if(!active_treatment.includes($(this).parent().attr('id'))){ + click_flag = true; + active_treatment.push($(this).parent().attr('id')); + click_flag = false; + }; + } + }); + }; + $('#current_year').change(function(){ + year = $(this).attr('value'); + $('.surgery_year').html(year); + $('.cancer_years').removeClass('active'); + $('#result_text_content .cancer_years').eq($(this).attr("index")).addClass('active'); + $('#result_table_content .cancer_years').eq($(this).attr("index")).addClass('active'); + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + calculate_and_change_result_value(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('#cancer_table .cancer_form_field').off('change').on('change',function(){ + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('#cancer_table .cancer_form_field').click(function(){ + $(this).change(); + }); + $('select.select_num').off('click').on('click',function(){ + $(this).change(); + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('.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'); + }else{ + $(this).css('color','#333'); + $(this).removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year}; + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }; + }); + }); + }; + }; + function after_submit_change_func(obj){ + var post_json = get_input_data(); + if(post_json != null){ + var new_lpv = calculate_first_lpv(post_json)['lpv_variable']; + var old_lpv = obj.lpv_real[0]; + obj.lpv_real = obj.lpv_real.map(original_value=>(change_object_variables(original_value,change_object_variables(new_lpv,old_lpv,'-'),'+'))); + calculate_and_change_result_value(obj); + }; + }; + /* auto add start */ + function calculate_first_lpv(result_json){ + result = {}; + var map_values , mapping_hash , temp_index ,temp_value , index , closest_value; + result['age'] = Number(result_json['age']); + result['size'] = Number(result_json['size']); + result['height'] = Number(result_json['height']); + result['weight'] = Number(result_json['weight']); + result['pstage'] = Number(result_json['pstage']); + result['sex'] = Number(result_json['sex']); + result['site'] = Number(result_json['site']); + result['lymph'] = Number(result_json['lymph']); + result['drinking'] = Number(result_json['drinking']); + result['smoking'] = Number(result_json['smoking']); + result['Chemotherapy'] = Number(result_json['Chemotherapy']); + result['Radiotherapy'] = Number(result_json['Radiotherapy']); + + Object.keys(result).forEach(function(k){ + if(Number.isNaN(result[k])){ + result[k] = 0; + } + }) + bmi = result["weight"] / ((result["height"] / 100.0) ** 2); + pstage_2 = (result["pstage"] == 2) ? 1 : 0; + pstage_3 = (result["pstage"] == 3) ? 1 : 0; + pstage_4 = (result["pstage"] == 4) ? 1 : 0; + sex_ind = (result["sex"] == 2) ? 1 : 0; + site_oralph = (result["site"] == 2) ? 1 : 0; + site_hyph = (result["site"] == 3) ? 1 : 0; + site_sal = (result["site"] == 4) ? 1 : 0; + site_lary = (result["site"] == 5) ? 1 : 0; + lymph_1 = (result["lymph"] == 2) ? 1 : 0; + lymph_2 = (result["lymph"] == 3) ? 1 : 0; + lymph_3 = (result["lymph"] == 4) ? 1 : 0; + lymph_4 = (result["lymph"] == 5) ? 1 : 0; + lymph_5 = (result["lymph"] == 6) ? 1 : 0; + lymph_6 = (result["lymph"] == 7) ? 1 : 0; + lymph_7 = (result["lymph"] == 8) ? 1 : 0; + drink_ind = (result["drinking"] == 1) ? 0 : 1; + smoke_ind = (result["smoking"] == 1) ? 0 : 1; + chemo = (result["Chemotherapy"] == 2) ? 1 : 0; + radio = (result["Radiotherapy"] == 2) ? 1 : 0; + try{ + lpv = ((result["age"]-56.13649)*0.00542+(result["size"]-26.24087)*0.01555+(bmi-24.71561)*(-0.03777)+ pstage_2*0.22023+pstage_3*0.11253+pstage_4*0.74585+ sex_ind*(-0.29218)+site_oralph*0.15131+site_hyph*(-0.18040)+site_sal*(-0.32440)+site_lary*(-0.19674)+ lymph_1*0.69354+lymph_2*0.85665+lymph_3*0.92695+lymph_4*0.93122+lymph_5*0.72533+ lymph_6*1.12371+lymph_7*1.13236+drink_ind*0.12961+smoke_ind*(-0.17848)+chemo*(0.15613)+radio*(-0.34129) + ) + }catch(e){console.log(e)}; + result['lpv_variable'] = {}; + result['lpv_variable']['lpv'] = lpv; + result['lpv'] = lpv; + result['lpv_variable']['lpv'] = result['lpv']; + return result; + }; + function calculate_and_change_result_value(obj){ + obj.servive_ratio_arr = []; + for(var i = 0;i=48&&event.keyCode<=57||(this.value.indexOf('.')<0?event.keyCode==46:false); + }); + $('.float_num').off('keyup').on('keyup',function(){ + this.value = this.value.replace(/[^\d.]/g,''); + }); + $('.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(){ + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }); + $('input#lymph_nodes_examined').siblings('select.select_num').off('change').on('change',function(){ + var range = $('input#lymph_nodes_positive').data('range'); + range[1] = Number($(this).val()); + $('input#lymph_nodes_positive').data('range_new', range); + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($('input#lymph_nodes_positive').siblings('.num_only_value').val()) <= Number($(this).val()) ){ + $('input#lymph_nodes_positive').css('color','#333'); + $('input#lymph_nodes_positive').removeClass('cancertable_empty'); + }; + if( Number($(this).val()) < $(this).siblings('.num_only').data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).siblings('.num_only').data('range_new')[1] && $(this).siblings('.num_only').data('range_new')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + $('input#lymph_nodes_positive').siblings('select.select_num').off('change').on('change',function(){ + var range = $('input#lymph_nodes_examined').data('range'); + range[0] = Number($(this).val()); + $('input#lymph_nodes_examined').data('range_new', range); + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($('input#lymph_nodes_examined').siblings('.num_only_value').val()) >= Number($(this).val()) ){ + $('input#lymph_nodes_examined').css('color','#333'); + $('input#lymph_nodes_examined').removeClass('cancertable_empty'); + }; + if( Number($(this).val()) < $(this).siblings('.num_only').data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).siblings('.num_only').data('range_new')[1] && $(this).siblings('.num_only').data('range_new')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + $('select.select_num').blur(function() { + if( Number($(this).siblings('.num_only_value').val()) < $(this).siblings('.num_only').data('range')[0] || $(this).siblings('.num_only_value').val() == "" || (Number($(this).siblings('.num_only_value').val()) > $(this).siblings('.num_only').data('range')[1] && $(this).siblings('.num_only').data('range')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + if($(window).width() < 768) + $('#hnc_cancer_predict_result').attr('style',''); +}); +$(window).resize(function(){ + if($(window).width() > 768){ + if($('.cancer_table_right_result').length != 0) + $('#hnc_cancer_predict_result').css('float','right'); + }else{ + $('#hnc_cancer_predict_result').attr('style',''); + }; + if(I18n.locale == 'en'){ + var window_width = $(window).width(); + if(window_width < 520){ + $('#cancer_table .cencer_table_name').css('max-width',''); + }else if(window_width < 768){ + $('#cancer_table .cencer_table_name').css({'max-width':'','width':'11em'}); + }else if(window_width < 860){ + $('#cancer_table .cencer_table_name').css('max-width','30%'); + }else if(window_width < 1130){ + $('#cancer_table .cencer_table_name').css('max-width','33%'); + }else{ + $('#cancer_table .cencer_table_name').css('max-width','39%'); + }; + }; +}); diff --git a/app/assets/javascripts/hnc_cancer_predict.js b/app/assets/javascripts/hnc_cancer_predict.js new file mode 100644 index 0000000..915b2bf --- /dev/null +++ b/app/assets/javascripts/hnc_cancer_predict.js @@ -0,0 +1,856 @@ +Array.prototype.get_nearest_value = function(goal){ + var nearest_value = this.reduce(function(prev, curr) { + return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev); + }); + return nearest_value; +} +function change_object_variables(obj1,obj2,operator="-",target="new"){ + var obj_new = {}; + var obj_keys = Object.keys(obj1); + obj_keys.forEach(function(k){ + if(obj2[k] == undefined){ + if( target == "new"){ + obj_new[k] = obj1[k]; + } + }else{ + if(operator == "-"){ + if( target == "new"){ + obj_new[k] = obj1[k] - obj2[k]; + }else{ + obj1[k] = obj1[k] - obj2[k]; + } + }else if(operator == "+"){ + if( target == "new"){ + obj_new[k] = obj1[k] + obj2[k]; + }else{ + obj1[k] = obj1[k] + obj2[k]; + } + } + } + }) + if( target == "new"){ + return obj_new; + }else{ + return obj1; + } +} +$(document).ready(function(){ + var head_data = $.post("/hnc_cancer_predictResult",{"header":1,locale:I18n.locale}); + var data = {}; + if(I18n.locale == 'en'){ + var window_width = $(window).width(); + if(window_width < 520){ + $('#cancer_table .cencer_table_name').css('max-width',''); + }else if(window_width < 768){ + $('#cancer_table .cencer_table_name').css({'max-width':'','width':'11em'}); + }else if(window_width < 860){ + $('#cancer_table .cencer_table_name').css('max-width','30%'); + }else if(window_width < 1130){ + $('#cancer_table .cencer_table_name').css('max-width','33%'); + }else{ + $('#cancer_table .cencer_table_name').css('max-width','39%'); + }; + }; + function round(num,Digit=0){ + return Math.round(Number(num)*(10**Digit))/(10**Digit); + }; + head_data.done(function(){ + if(head_data.responseJSON['hnc_head_images'] != ''){ + $('.header-nav').html(head_data.responseJSON['hnc_head_images']); + } + if(head_data.responseJSON['title'] != ''){ + $('.navbar-brand').html(head_data.responseJSON['title']); + } + data['danger_texts'] = head_data.responseJSON['danger_texts']; + $('head title').text(head_data.responseJSON['page_title']) + }); + var mapping_data = $.post("/hnc_cancer_predictResult",{"get_mapping_data_from_csv":1,locale:I18n.locale}); + mapping_data.done(function(){ + // $('.header-nav').html(hnc_head_images.responseJSON['hnc_head_images']); + // $('.navbar-brand').html(hnc_head_images.responseJSON['title']) + window.mapping_data_from_csv = mapping_data.responseJSON['mapping_data_from_csv']; + }); + Array.prototype.remove_item_from_array = function(){ + var result_array = this; + for(var i=0;i $(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(); + }; + }; + }); + $('input#lymph_nodes_positive').off('input').on('input',function(){ + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($(this).val()) < $(this).data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range_new')[1] && $(this).data('range_new')[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(); + }; + }; + }); + $('input#lymph_nodes_examined').off('input').on('input',function(){ + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($(this).val()) < $(this).data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).data('range_new')[1] && $(this).data('range_new')[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(); + }; + }; + }); + $('.cancer_help_btn').off("click").on('click',function(){ + var modal_head = ""; + try{ modal_head = $(this).parent().find(">label").html()}catch(e){}; + var modal_body = ""; + try{ modal_body = $(this).parent().find(">input.help_texts").attr('value')}catch(e){}; + $('#show_help_modal').html("") + $('#show_help_modal').modal('show'); + $('#show_help_modal .close').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + $('#show_help_modal .modal-footer button').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + }); + $('.btn-add').click(function(){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[1]; + if(compare_value != undefined){ + if(input_value+1 <= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value+1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value+1); + }; + compare_value = $(this).parent().find('.num_only').data('range')[0]; + if(compare_value != undefined){ + if($(this).parent().find('.num_only').val() >= compare_value){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }else{ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }catch(e){ + $(this).parent().find('.num_only').val(0); + }; + if($(this).parent().find('.num_only').val() != ""){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + }; + }); + $('.btn-sub').click(function(){ + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[0]; + if(compare_value != undefined){ + if(input_value-1 >= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value-1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value-1); + }; + compare_value = $(this).parent().find('.num_only').data('range')[1]; + if(compare_value != undefined){ + if($(this).parent().find('.num_only').val() <= compare_value){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }else{ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined){ + $(this).parent().find('.num_only').val(input_value); + }else{ + input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + } + }catch(e){ + $(this).parent().find('.num_only').val(0); + }; + if($(this).parent().find('.num_only').val() != ""){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + $(this).parent().find('.num_only').css('color','#333'); + }; + }; + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }); + $('.cancer_table_btn').off('click').on('click',function(){ + 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(e){}; + $(this).addClass('active'); + }); + $('#cancer_table_reset').click(function(){ + $('.cancer_table_btn').removeClass('active'); + $('.cancer-btn-group input').attr('value',0); + $('.num_only').val(''); + $('.num_only_value').val(''); + $('#cancer_table .cancer_form_field').removeClass('cancertable_empty'); + $('#hnc_cancer_predict_result_block').css('display','none'); + $('#danger_texts').remove(); + $('select.select_num').val(''); + }); + function get_input_data(){ + var flag; + flag = 1; + for(var i = 0;i < $('#cancer_table .cancer_form_field').length;i++){ + if($('#cancer_table .cancer_form_field').eq(i).hasClass('num_only')){ + if($('#cancer_table .cancer_form_field').eq(i).val()==""){ + flag = 0; + $('#cancer_table .cancer_form_field').eq(i).addClass('cancertable_empty'); + }else if($('#cancer_table .cancer_form_field').eq(i).val() != "" && !$('#cancer_table .cancer_form_field').eq(i).hasClass('cancertable_empty')){ + $('#cancer_table .cancer_form_field').eq(i).removeClass('cancertable_empty'); + }; + }else{ + if($('#cancer_table .cancer_form_field').eq(i).find('[value="1"]').length == 0){ + flag = 0; + $('#cancer_table .cancer_form_field').eq(i).addClass('cancertable_empty'); + }else{ + $('#cancer_table .cancer_form_field').eq(i).removeClass('cancertable_empty'); + } + }; + }; + if( Number($('input#lymph_nodes_examined').siblings('.num_only_value').val()) < Number($('input#lymph_nodes_positive').siblings('.num_only_value').val())){ + $('input#lymph_nodes_positive').addClass('cancertable_empty'); + $('input#lymph_nodes_positive').css('color','rgb(242, 74, 105)'); + }; + if($('.cancertable_empty').length != 0){ + flag = 0; + ($('#danger_texts').length == 0) ? $('#cancer_table_submit').parent().before(''+data['danger_texts']+'') : null; + $('#danger_texts').css('margin-left',$(window).width()/2-$('#danger_texts').width()/2); + }else{ + $('#danger_texts').remove(); + }; + if(flag == 1){ + var post_json= {}; + for(var i = 0;i < $('#cancer_table .cancer_form_field').length;i++){ + var name = $('#cancer_table .cancer_form_field').eq(i).attr('id') + if($('#cancer_table .cancer_form_field').eq(i).hasClass('num_only')) + post_json[name] = Number($('#cancer_table .cancer_form_field').eq(i).siblings('.num_only_value').val()); + else{ + var index = ($('#cancer_table .cancer_form_field').eq(i).find('[value="1"]').index()+1)/2; + post_json[name] = index; + }; + }; + if( post_json["ER_status"] == 2 && post_json["PR_status"] == 2 ){ + $('#hormone_therapy .cancer_table_btn').attr('disabled','disabled'); + $('[for="hormone_therapy"]').css('color','rgb(204, 204, 204)'); + }else{ + $('#hormone_therapy .cancer_table_btn').removeAttr('disabled'); + $('[for="hormone_therapy"]').css('color',''); + }; + /*disable_condition start*/ + /*disable_condition end*/ + return post_json; + }else{ + return null; + } + }; + function set_result(result){ + if(result.responseJSON.lpv != "error"){ + $('#choice_fields .cancer_table_btn').removeClass('active'); + var load_heml = $('#result_table_content').html(result.responseJSON.table); + load_heml.ready(function(){ + $('#result_table_content .cancer_years').eq(-1).addClass('active'); + for(var i = 0;i < $('#result_table_content .cancer_years').length;i++){ + $('#result_table_content .cancer_years').eq(i).attr('index',i) + }; + $('#result_table_content .cancer_years').off('click').on('click',function(){ + try{ + $(this).parent().find('.cancer_years').removeClass('active'); + }catch(e){}; + $(this).addClass('active'); + $('#current_year').attr('index',$(this).attr('index')); + $('#current_year').attr('value',$(this).html()); + $('#current_year').change(); + }); + }); + load_heml = $('#result_text_content').html(result.responseJSON.texts); + load_heml.ready(function(){ + $('#result_text_content .cancer_years').eq(-1).addClass('active'); + for(var i = 0;i < $('#result_text_content .cancer_years').length;i++){ + $('#result_text_content .cancer_years').eq(i).attr('index',i) + }; + $('#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'); + }catch(e){}; + $(this).addClass('active'); + $('#current_year').attr('value',$(this).html()); + $('#current_year').attr('index',$(this).attr('index')); + $('.surgery_year').html($(this).html()); + $('#current_year').change(); + }); + $('#cancer_table_right_result .cancer-btn-group .cancer_table_btn').removeClass('active'); + $('#cancer_table_right_result .cancer-btn-group >input').attr('value',"0"); + for(var i = 0;i < $('#cancer_table_left_result .cancer-btn-group').length;i++){ + $('#cancer_table_left_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); + $('#cancer_table_left_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1"); + }; + for(var i = 0;i < $('#cancer_table_right_result .cancer-btn-group').length;i++){ + $('#cancer_table_right_result .cancer-btn-group').eq(i).find('.cancer_table_btn').eq(0).addClass('active'); + $('#cancer_table_right_result .cancer-btn-group').eq(i).find('>input').eq(0).attr('value',"1"); + }; + var treatment_method = result.responseJSON.treatment_method; + var treatment_method_active_indices = result.responseJSON.treatment_method_active_indices; + $('tr.'+treatment_method[0]).addClass('tr_show'); + var servive_ratio_arr = [result.responseJSON.servive_ratio] + var yes = (I18n.locale=="zh_tw") ? "是" : "yes"; + var year = $('#current_year').attr('value'); + var active_treatment = ['Surgery_only']; + $('tr.'+active_treatment[0]+' .Overall_Survival').html(servive_ratio_arr[0]+'%'); + $('span.'+active_treatment[0]+'.Overall_Survival').html(Math.round(servive_ratio_arr[0])); + $('#hnc_cancer_predict_result_block').css('display','block'); + var lpv_real = [result.responseJSON['lpv_variable']]; + var lpv = /*therapy_lpv start*/[0, 0.15613, -0.34129];/*therapy_lpv end*/; + var lpv_dict={}; + var lpv_calc=/*lpv_calc_formula_start*/{"1":"Math.exp(-0.03639284)**( Math.exp(lpv_current) )","3":"Math.exp(-0.08738490)**( Math.exp(lpv_current) )","5":"Math.exp(-0.10683094)**( Math.exp(lpv_current) )"};/*lpv_calc_formula_end*/ + active_treatment.push = function() { + if(arguments.length == 1){ + var year = $('#current_year').attr('value'); + console.log(lpv_real); + console.log(lpv_dict[arguments[0]]) + var lpv_current = change_object_variables(lpv_real[lpv_real.length-1],{"lpv": lpv_dict[arguments[0]]},'+'); + lpv_real.push(lpv_current); + lpv_current = lpv_current['lpv']; + var servive_ratio = round(eval(lpv_calc[year])*100,2); + var benefit = servive_ratio - servive_ratio_arr[servive_ratio_arr.length - 1]; + servive_ratio_arr.push(servive_ratio); + $('tr.'+arguments[0]+' td.Overall_Survival').html(servive_ratio+'%'); + $('tr.'+arguments[0]+' td.Additional_Benefit').html(round(benefit,2)+'%'); + $('tr.'+arguments[0]).css('display','table-row'); + $('tr.tr_show').eq(-1).after($('tr.'+arguments[0])); + $('tr.'+arguments[0]).addClass('tr_show'); + if(this.length == 1){ + $('.addition').css('display','inline-block'); + $('#result_text_content .extra-text').css('display','inline-block'); + } + var add_choices = this.slice(1,this.length); + add_choices.push(arguments[0]); + var add_choices_transform = []; + for(var i = 0;i= 2) + add_choices_str += ((I18n.locale == 'en' ? ', and ': '以及')+add_choices_transform[add_choices_transform.length-1]) + else + add_choices_str = add_choices_transform[0]; + var extra_therapy_texts = result.responseJSON['extra_therapy_texts']; + extra_therapy_texts = extra_therapy_texts.replace('{{extra_therapy}}','
'+add_choices_str+''); + extra_therapy_texts = extra_therapy_texts.replace('{{survival_num}}',''+Math.round(servive_ratio)+''); + extra_therapy_texts = extra_therapy_texts.replace('{{surgery_year}}',''+year+''); + extra_therapy_texts = extra_therapy_texts.replace('{{Additional_Benefit}}',''+Math.round(benefit)+''); + var new_text = '

'; + new_text += (extra_therapy_texts+'

'); + $('#result_text_content .extra-text .texts_show').eq(-1).after(new_text) + return Array.prototype.push.apply(this, arguments); + }else{ + return Array.prototype.push.apply(this, arguments); + } + }; + active_treatment.remove_item_from_array = function(){ + if(arguments.length == 1 && !Array.isArray(arguments[0])){ + var index = this.indexOf(arguments[0]) + var year = $('#current_year').attr('value'); + if(index < this.length - 1){ + for(var i = index + 1;i < this.length; i++){ + change_object_variables(lpv_real[i] , {"lpv": lpv_dict[arguments[0]]} , '-' , 'self'); + var lpv_current = lpv_real[i]; + lpv_current = lpv_current['lpv']; + var servive_ratio = round(eval(lpv_calc[year])*100,2); + 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(Math.round(servive_ratio)); + $('tr.'+active_treatment[i]+' td.Additional_Benefit').html(round(benefit,2)+'%'); + $('.'+active_treatment[i]+'.Additional_Benefit').html(Math.round(benefit)); + }; + var add_choices = []; + for(var i = 1;i < this.length; i++){ + if(i != index){ + add_choices.push(this[i]); + var add_choices_transform = []; + for(var j = 0;j= 2) + add_choices_str += ((I18n.locale == 'en' ? ', and ': '以及')+add_choices_transform[add_choices_transform.length-1]) + else + add_choices_str = add_choices_transform[0]; + $('.'+active_treatment[i]+'.choices').html(add_choices_str); + } + }; + }; + $('tr.'+arguments[0]+' td.Overall_Survival').html('-'); + $('tr.'+arguments[0]+' td.Additional_Benefit').html('-'); + $('tr.'+arguments[0]).css('display','none'); + $('tr.'+arguments[0]).removeClass('tr_show'); + $('span.'+arguments[0]).eq(0).parent().remove(); + lpv_real = lpv_real.remove_item_from_array(lpv_real[index]); + servive_ratio_arr = servive_ratio_arr.remove_item_from_array(servive_ratio_arr[index]); + if(this.length == 2){ + $('.addition').css('display','none'); + $('#result_text_content .extra-text').css('display','none'); + }; + return Array.prototype.remove_item_from_array.apply(this, arguments); + }else{ + return Array.prototype.remove_item_from_array.apply(this, arguments); + }; + }; + for(var i = 0;iinput').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(e){}; + $(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')); + click_flag = false; + }; + }; + }); + $('#'+treatment_method[i]+' .cancer_table_btn').eq(treatment_method_active_indices[i]).off('click').click(function(){ + 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(e){}; + $(this).addClass('active'); + if(!click_flag){ + if(!active_treatment.includes($(this).parent().attr('id'))){ + click_flag = true; + active_treatment.push($(this).parent().attr('id')); + click_flag = false; + }; + } + }); + }; + $('#current_year').change(function(){ + year = $(this).attr('value'); + $('.surgery_year').html(year); + $('.cancer_years').removeClass('active'); + $('#result_text_content .cancer_years').eq($(this).attr("index")).addClass('active'); + $('#result_table_content .cancer_years').eq($(this).attr("index")).addClass('active'); + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + calculate_and_change_result_value(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('#cancer_table .cancer_form_field').off('change').on('change',function(){ + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('#cancer_table .cancer_form_field').click(function(){ + $(this).change(); + }); + $('select.select_num').off('click').on('click',function(){ + $(this).change(); + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year} + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }); + $('.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'); + }else{ + $(this).css('color','#333'); + $(this).removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + var obj = {"servive_ratio_arr":servive_ratio_arr,"active_treatment":active_treatment,"lpv_real":lpv_real,"lpv_calc":lpv_calc,"year":year}; + after_submit_change_func(obj); + servive_ratio_arr = obj.servive_ratio_arr; + active_treatment = obj.active_treatment; + lpv_real = obj.lpv_real; + lpv_calc = obj.lpv_calc; + year = obj.year; + }; + }); + }); + }; + }; + function after_submit_change_func(obj){ + var post_json = get_input_data(); + if(post_json != null){ + var new_lpv = calculate_first_lpv(post_json)['lpv_variable']; + var old_lpv = obj.lpv_real[0]; + obj.lpv_real = obj.lpv_real.map(original_value=>(change_object_variables(original_value,change_object_variables(new_lpv,old_lpv,'-'),'+'))); + calculate_and_change_result_value(obj); + }; + }; + /* auto add start */ + function calculate_first_lpv(result_json){ + result = {}; + var map_values , mapping_hash , temp_index ,temp_value , index , closest_value; + result['age'] = Number(result_json['age']); + result['size'] = Number(result_json['size']); + result['height'] = Number(result_json['height']); + result['weight'] = Number(result_json['weight']); + result['pstage'] = Number(result_json['pstage']); + result['sex'] = Number(result_json['sex']); + result['site'] = Number(result_json['site']); + result['lymph'] = Number(result_json['lymph']); + result['drinking'] = Number(result_json['drinking']); + result['smoking'] = Number(result_json['smoking']); + result['Chemotherapy'] = Number(result_json['Chemotherapy']); + result['Radiotherapy'] = Number(result_json['Radiotherapy']); + + Object.keys(result).forEach(function(k){ + if(Number.isNaN(result[k])){ + result[k] = 0; + } + }) + bmi = result["weight"] / ((result["height"] / 100.0) ** 2); + pstage_2 = (result["pstage"] == 2) ? 1 : 0; + pstage_3 = (result["pstage"] == 3) ? 1 : 0; + pstage_4 = (result["pstage"] == 4) ? 1 : 0; + sex_ind = (result["sex"] == 2) ? 1 : 0; + site_oralph = (result["site"] == 2) ? 1 : 0; + site_hyph = (result["site"] == 3) ? 1 : 0; + site_sal = (result["site"] == 4) ? 1 : 0; + site_lary = (result["site"] == 5) ? 1 : 0; + lymph_1 = (result["lymph"] == 2) ? 1 : 0; + lymph_2 = (result["lymph"] == 3) ? 1 : 0; + lymph_3 = (result["lymph"] == 4) ? 1 : 0; + lymph_4 = (result["lymph"] == 5) ? 1 : 0; + lymph_5 = (result["lymph"] == 6) ? 1 : 0; + lymph_6 = (result["lymph"] == 7) ? 1 : 0; + lymph_7 = (result["lymph"] == 8) ? 1 : 0; + drink_ind = (result["drinking"] == 1) ? 0 : 1; + smoke_ind = (result["smoking"] == 1) ? 0 : 1; + chemo = (result["Chemotherapy"] == 2) ? 1 : 0; + radio = (result["Radiotherapy"] == 2) ? 1 : 0; + try{ + lpv = ((result["age"]-56.13649)*0.00542+(result["size"]-26.24087)*0.01555+(bmi-24.71561)*(-0.03777)+ pstage_2*0.22023+pstage_3*0.11253+pstage_4*0.74585+ sex_ind*(-0.29218)+site_oralph*0.15131+site_hyph*(-0.18040)+site_sal*(-0.32440)+site_lary*(-0.19674)+ lymph_1*0.69354+lymph_2*0.85665+lymph_3*0.92695+lymph_4*0.93122+lymph_5*0.72533+ lymph_6*1.12371+lymph_7*1.13236+drink_ind*0.12961+smoke_ind*(-0.17848)+chemo*(0.15613)+radio*(-0.34129) + ) + }catch(e){console.log(e)}; + result['lpv_variable'] = {}; + result['lpv_variable']['lpv'] = lpv; + result['lpv'] = lpv; + result['lpv_variable']['lpv'] = result['lpv']; + return result; + }; + function calculate_and_change_result_value(obj){ + obj.servive_ratio_arr = []; + for(var i = 0;i=48&&event.keyCode<=57||(this.value.indexOf('.')<0?event.keyCode==46:false); + }); + $('.float_num').off('keyup').on('keyup',function(){ + this.value = this.value.replace(/[^\d.]/g,''); + }); + $('.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(){ + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }); + $('input#lymph_nodes_examined').siblings('select.select_num').off('change').on('change',function(){ + var range = $('input#lymph_nodes_positive').data('range'); + range[1] = Number($(this).val()); + $('input#lymph_nodes_positive').data('range_new', range); + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($('input#lymph_nodes_positive').siblings('.num_only_value').val()) <= Number($(this).val()) ){ + $('input#lymph_nodes_positive').css('color','#333'); + $('input#lymph_nodes_positive').removeClass('cancertable_empty'); + }; + if( Number($(this).val()) < $(this).siblings('.num_only').data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).siblings('.num_only').data('range_new')[1] && $(this).siblings('.num_only').data('range_new')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + $('input#lymph_nodes_positive').siblings('select.select_num').off('change').on('change',function(){ + var range = $('input#lymph_nodes_examined').data('range'); + range[0] = Number($(this).val()); + $('input#lymph_nodes_examined').data('range_new', range); + if(this.selectedIndex != 0){ + $(this).siblings('input.num_only').val($(this).find('option').eq(this.selectedIndex).text()); + $(this).siblings('input.num_only').removeClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','#333'); + }else{ + $(this).siblings('input.num_only').addClass('cancertable_empty'); + $(this).siblings('input.num_only').css('color','rgb(242, 74, 105)'); + $(this).siblings('input.num_only').val($(this).val()); + } + $(this).siblings('input.num_only_value').val($(this).val()); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + $(this).siblings('.num_only_value').val($(this).val()); + if( Number($('input#lymph_nodes_examined').siblings('.num_only_value').val()) >= Number($(this).val()) ){ + $('input#lymph_nodes_examined').css('color','#333'); + $('input#lymph_nodes_examined').removeClass('cancertable_empty'); + }; + if( Number($(this).val()) < $(this).siblings('.num_only').data('range_new')[0] || $(this).val() == "" || (Number($(this).val()) > $(this).siblings('.num_only').data('range_new')[1] && $(this).siblings('.num_only').data('range_new')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + $('select.select_num').blur(function() { + if( Number($(this).siblings('.num_only_value').val()) < $(this).siblings('.num_only').data('range')[0] || $(this).siblings('.num_only_value').val() == "" || (Number($(this).siblings('.num_only_value').val()) > $(this).siblings('.num_only').data('range')[1] && $(this).siblings('.num_only').data('range')[1] != undefined) ){ + $(this).siblings('.num_only').css('color','#f24a69'); + $(this).siblings('.num_only').addClass('cancertable_empty'); + }else{ + $(this).siblings('.num_only').css('color','#333'); + $(this).siblings('.num_only').removeClass('cancertable_empty'); + if($('.cancertable_empty').length == 0){ + $('#danger_texts').remove(); + }; + }; + }); + if($(window).width() < 768) + $('#hnc_cancer_predict_result').attr('style',''); +}); +$(window).resize(function(){ + if($(window).width() > 768){ + if($('.cancer_table_right_result').length != 0) + $('#hnc_cancer_predict_result').css('float','right'); + }else{ + $('#hnc_cancer_predict_result').attr('style',''); + }; + if(I18n.locale == 'en'){ + var window_width = $(window).width(); + if(window_width < 520){ + $('#cancer_table .cencer_table_name').css('max-width',''); + }else if(window_width < 768){ + $('#cancer_table .cencer_table_name').css({'max-width':'','width':'11em'}); + }else if(window_width < 860){ + $('#cancer_table .cencer_table_name').css('max-width','30%'); + }else if(window_width < 1130){ + $('#cancer_table .cencer_table_name').css('max-width','33%'); + }else{ + $('#cancer_table .cencer_table_name').css('max-width','39%'); + }; + }; +}); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.smartmenus.bootstrap.min.js b/app/assets/javascripts/jquery.smartmenus.bootstrap.min.js new file mode 100644 index 0000000..3cad4e3 --- /dev/null +++ b/app/assets/javascripts/jquery.smartmenus.bootstrap.min.js @@ -0,0 +1,3 @@ +/*! SmartMenus jQuery Plugin Bootstrap Addon - v0.4.1 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery","smartmenus"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function(t){return t.extend(t.SmartMenus.Bootstrap={},{keydownFix:!1,init:function(){var e=t("ul.navbar-nav:not([data-sm-skip])");e.each(function(){function e(){o.find("a.current").parent().addClass("active"),o.find("a.has-submenu").each(function(){var e=t(this);e.is('[data-toggle="dropdown"]')&&e.dataSM("bs-data-toggle-dropdown",!0).removeAttr("data-toggle"),e.is('[role="button"]')&&e.dataSM("bs-role-button",!0).removeAttr("role")})}function s(){o.find("a.current").parent().removeClass("active"),o.find("a.has-submenu").each(function(){var e=t(this);e.dataSM("bs-data-toggle-dropdown")&&e.attr("data-toggle","dropdown").removeDataSM("bs-data-toggle-dropdown"),e.dataSM("bs-role-button")&&e.attr("role","button").removeDataSM("bs-role-button")})}function i(t){var e=a.getViewportWidth();if(e!=n||t){var s=o.find(".caret");a.isCollapsible()?(o.addClass("sm-collapsible"),o.is("[data-sm-skip-collapsible-behavior]")||s.addClass("navbar-toggle sub-arrow")):(o.removeClass("sm-collapsible"),o.is("[data-sm-skip-collapsible-behavior]")||s.removeClass("navbar-toggle sub-arrow")),n=e}}var o=t(this),a=o.data("smartmenus");if(!a){o.smartmenus({subMenusSubOffsetX:2,subMenusSubOffsetY:-6,subIndicators:!1,collapsibleShowFunction:null,collapsibleHideFunction:null,rightToLeftSubMenus:o.hasClass("navbar-right"),bottomToTopSubMenus:o.closest(".navbar").hasClass("navbar-fixed-bottom")}).on({"show.smapi":function(e,s){var i=t(s),o=i.dataSM("scroll-arrows");o&&o.css("background-color",t(document.body).css("background-color")),i.parent().addClass("open")},"hide.smapi":function(e,s){t(s).parent().removeClass("open")}}),e(),a=o.data("smartmenus"),a.isCollapsible=function(){return!/^(left|right)$/.test(this.$firstLink.parent().css("float"))&&"block"==this.$root.css("display")},a.refresh=function(){t.SmartMenus.prototype.refresh.call(this),e(),i(!0)},a.destroy=function(e){s(),t.SmartMenus.prototype.destroy.call(this,e)},o.is("[data-sm-skip-collapsible-behavior]")&&(a.opts.collapsibleBehavior="toggle");var n;i(),t(window).on("resize.smartmenus"+a.rootId,i)}}),e.length&&!t.SmartMenus.Bootstrap.keydownFix&&(t(document).off("keydown.bs.dropdown.data-api",".dropdown-menu"),t.fn.dropdown&&t.fn.dropdown.Constructor&&t(document).on("keydown.bs.dropdown.data-api",'.dropdown-menu:not([id^="sm-"])',t.fn.dropdown.Constructor.prototype.keydown),t.SmartMenus.Bootstrap.keydownFix=!0)}}),t(t.SmartMenus.Bootstrap.init),t}); \ No newline at end of file diff --git a/app/assets/javascripts/jquery.smartmenus.min.js b/app/assets/javascripts/jquery.smartmenus.min.js new file mode 100644 index 0000000..4f98566 --- /dev/null +++ b/app/assets/javascripts/jquery.smartmenus.min.js @@ -0,0 +1,3 @@ +/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/app/assets/stylesheets/admin/hnc_cancer_predict.css b/app/assets/stylesheets/admin/hnc_cancer_predict.css new file mode 100644 index 0000000..50070f8 --- /dev/null +++ b/app/assets/stylesheets/admin/hnc_cancer_predict.css @@ -0,0 +1,88 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ +thead > tr > th{ + border:1px solid; + background: bisque; +} +tbody{ + background:white; +} +tbody > tr > td{ + border:1px solid; + position: relative; +} +.show_li,.show_li *{ + list-style:none; + color:balck; +} +.show_li ul{ + display:none; +} +#clicktosee{ + color:blue; + cursor:pointer; +} +table .checkbox{ + left: 50%; + position: absolute; + transform: translate(-50%, -50%) !important; + top: 50%; +} +#updatebtn{ + margin-top: 1em; + right: 1em; + background-color: #0088cc; + color: white; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; +} +.show_span{ + margin: 1em; + float: left; + background-color: rgb(210, 105, 0); + color: white; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + width: fit-content; +} +.label_left{ + float: left; + padding-right: 0.5em; +} +.PageDetails { + padding-top: 0.1875em; + padding-bottom: 0.1875em; + font-weight: bold; + font-size: 0.875em; + border-bottom: 0.0625em solid #ddd; + overflow: hidden; + text-align: right; + color: black; + font-size: 1.3em; +} +.PageList { + margin: 0em 0em 0 0.5em; + font-weight: bold; + font-size: 0.875em; + overflow: hidden; + list-style: none; + display: inline; + background: none; + color: #999; +} +ol { + margin: 0 0 0.5em 0; + min-height: 0.625em; + height: auto !important; + height: 0.625em; + padding: 0; + clear: both; + float: right; +} +.PageList li { + display: inline; +} \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap.min.print.css b/app/assets/stylesheets/bootstrap.min.print.css new file mode 100644 index 0000000..afc4d1e --- /dev/null +++ b/app/assets/stylesheets/bootstrap.min.print.css @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * //*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:0.0625em dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 2.5em}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 0.125em;border:0.0625em solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:0.0625em;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:0.625em;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:0.875em;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:0.3125em auto -webkit-focus-ring-color;outline-offset:-0.125em}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:0.375em}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:0.25em;line-height:1.42857143;background-color:#fff;border:0.0625em solid #ddd;border-radius:0.25em;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:1.25em;margin-bottom:1.25em;border:0;border-top:0.0625em solid #eee}.sr-only{position:absolute;width:0.0625em;height:0.0625em;padding:0;margin:-0.0625em;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:1.25em;margin-bottom:0.625em}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:0.625em;margin-bottom:0.625em}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:2.250em}.h2,h2{font-size:1.875em}.h3,h3{font-size:1.500em}.h4,h4{font-size:1.125em}.h5,h5{font-size:0.875em}.h6,h6{font-size:0.750em}p{margin:0 0 0.625em}.lead{margin-bottom:1.25em;font-size:1em;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:1.313em}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:0.5625em;margin:2.5em 0 1.25em;border-bottom:0.0625em solid #eee}ol,ul{margin-top:0;margin-bottom:0.625em}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-0.3125em;list-style:none}.list-inline>li{display:inline-block;padding-right:0.3125em;padding-left:0.3125em}dl{margin-top:0;margin-bottom:1.25em}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:10em;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:11.25em}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:0.0625em dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0.625em 1.25em;margin:0 0 1.25em;font-size:1.094em;border-left:0.3125em solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:0.9375em;padding-left:0;text-align:right;border-right:0.3125em solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:1.25em;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:0.125em 0.25em;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:0.25em}kbd{padding:0.125em 0.25em;font-size:90%;color:#fff;background-color:#333;border-radius:0.1875em;-webkit-box-shadow:inset 0 -0.0625em 0 rgba(0,0,0,.25);box-shadow:inset 0 -0.0625em 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.0.3125em;margin:0 0 0.625em;font-size:0.813em;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:0.0625em solid #ccc;border-radius:0.25em}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:32.5em;overflow-y:scroll}.container{padding-right:0.9375em;padding-left:0.9375em;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:46.875em}}@media (min-width:990.125em){.container{width:60.625em}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:0.9375em;padding-left:0.9375em;margin-right:auto;margin-left:auto}.row{margin-right:-0.9375em;margin-left:-0.9375em}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:0.0625em;padding-right:0.9375em;padding-left:0.9375em}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:990.125em){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:0.5em;padding-bottom:0.5em;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:1.25em}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:0.5em;line-height:1.42857143;vertical-align:top;border-top:0.0625em solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:0.125em solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:0.125em solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:0.3125em}.table-bordered{border:0.0625em solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:0.0625em solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:0.125em}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:0.9375em;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:0.0625em solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:1.25em;font-size:1.313em;line-height:inherit;color:#333;border:0;border-bottom:0.0625em solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:0.3125em;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:0.25em 0 0;margin-top:0.0625em\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:0.3125em auto -webkit-focus-ring-color;outline-offset:-0.125em}output{display:block;padding-top:0.4375em;font-size:0.875em;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:30.25em;padding:0.375em 1.125em;font-size:0.875em;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:0.0625em solid #ccc;border-radius:0.25em;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.5em rgba(102,175,233,.6);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.5em rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:30.25em}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:1.875em}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:40.375em}}.form-group{margin-bottom:0.9375em}.checkbox,.radio{position:relative;display:block;margin-top:0.625em;margin-bottom:0.625em}.checkbox label,.radio label{min-height:1.25em;padding-left:1.25em;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:0.25em\9;margin-left:-1.25em}.checkbox+.checkbox,.radio+.radio{margin-top:-0.3125em}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:1.25em;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:0.625em}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:30.25em;padding-top:0.4375em;padding-bottom:0.4375em;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:1.875em;padding:0.3125em 0.625em;font-size:0.750em;line-height:1.5;border-radius:0.1875em}select.input-sm{height:1.875em;line-height:1.875em}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:1.875em;padding:0.3125em 0.625em;font-size:0.750em;line-height:1.5;border-radius:0.1875em}.form-group-sm select.form-control{height:1.875em;line-height:1.875em}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:1.875em;min-height:30.125em;padding:0.375em 0.625em;font-size:0.750em;line-height:1.5}.input-lg{height:40.375em;padding:0.625em 10.375em;font-size:1.125em;line-height:1.3333333;border-radius:0.375em}select.input-lg{height:40.375em;line-height:40.375em}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:40.375em;padding:0.625em 10.375em;font-size:1.125em;line-height:1.3333333;border-radius:0.375em}.form-group-lg select.form-control{height:40.375em;line-height:40.375em}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:40.375em;min-height:2.375em;padding:10.0625em 10.375em;font-size:1.125em;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.0.3125em}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:30.25em;height:30.25em;line-height:30.25em;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:40.375em;height:40.375em;line-height:40.375em}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:1.875em;height:1.875em;line-height:1.875em}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #67b168;box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #c0a16b;box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #ce8483;box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.075),0 0 0.375em #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:20.3125em}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:0.3125em;margin-bottom:0.625em;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:0.4375em;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:1.6875em}.form-horizontal .form-group{margin-right:-0.9375em;margin-left:-0.9375em}@media (min-width:768px){.form-horizontal .control-label{padding-top:0.4375em;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:0.9375em}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:10.0625em;font-size:1.125em}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:0.375em;font-size:0.750em}}.btn{display:inline-block;padding:0.375em 1.125em;margin-bottom:0;font-size:0.875em;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:0.0625em solid transparent;border-radius:0.25em}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:0.3125em auto -webkit-focus-ring-color;outline-offset:-0.125em}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 0.1875em 0.3125em rgba(0,0,0,.125);box-shadow:inset 0 0.1875em 0.3125em rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:0.625em 10.375em;font-size:1.125em;line-height:1.3333333;border-radius:0.375em}.btn-group-sm>.btn,.btn-sm{padding:0.3125em 0.625em;font-size:0.750em;line-height:1.5;border-radius:0.1875em}.btn-group-xs>.btn,.btn-xs{padding:0.0625em 0.3125em;font-size:0.750em;line-height:1.5;border-radius:0.1875em}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:0.3125em}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:0.125em;vertical-align:middle;border-top:0.25em dashed;border-top:0.25em solid\9;border-right:0.25em solid transparent;border-left:0.25em solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10em;padding:0.3125em 0;margin:0.125em 0 0;font-size:0.875em;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:0.0625em solid #ccc;border:0.0625em solid rgba(0,0,0,.15);border-radius:0.25em;-webkit-box-shadow:0 0.375em 1.125em rgba(0,0,0,.175);box-shadow:0 0.375em 1.125em rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:0.0625em;margin:0.5625em 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:0.1875em 1.25em;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:0.1875em 1.25em;font-size:0.750em;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:0.25em dashed;border-bottom:0.25em solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:0.125em}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-0.0625em}.btn-toolbar{margin-left:-0.3125em}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:0.3125em}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:0.5em;padding-left:0.5em}.btn-group>.btn-lg+.dropdown-toggle{padding-right:1.125em;padding-left:1.125em}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 0.1875em 0.3125em rgba(0,0,0,.125);box-shadow:inset 0 0.1875em 0.3125em rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:0.3125em 0.3125em 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 0.3125em 0.3125em}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-0.0625em;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:0.25em;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:0.25em}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:40.375em;padding:0.625em 10.375em;font-size:1.125em;line-height:1.3333333;border-radius:0.375em}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:40.375em;line-height:40.375em}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:1.875em;padding:0.3125em 0.625em;font-size:0.750em;line-height:1.5;border-radius:0.1875em}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:1.875em;line-height:1.875em}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:0.375em 1.125em;font-size:0.875em;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:0.0625em solid #ccc;border-radius:0.25em}.input-group-addon.input-sm{padding:0.3125em 0.625em;font-size:0.750em;border-radius:0.1875em}.input-group-addon.input-lg{padding:0.625em 10.375em;font-size:1.125em;border-radius:0.375em}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-0.0625em}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-0.0625em}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-0.0625em}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:0.625em 0.9375em}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:0.0625em;margin:0.5625em 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:0.0625em solid #ddd}.nav-tabs>li{float:left;margin-bottom:-0.0625em}.nav-tabs>li>a{margin-right:0.125em;line-height:1.42857143;border:0.0625em solid transparent;border-radius:0.25em 0.25em 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:0.0625em solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:0.3125em;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:0.25em}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:0.0625em solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:0.0625em solid #ddd;border-radius:0.25em 0.25em 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:0.25em}.nav-pills>li+li{margin-left:0.125em}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:0.125em;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:0.3125em;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:0.25em}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:0.0625em solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:0.0625em solid #ddd;border-radius:0.25em 0.25em 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-0.0625em;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:3.125em;margin-bottom:1.25em;border:0.0625em solid transparent}@media (min-width:768px){.navbar{border-radius:0.25em}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:0.9375em;padding-left:0.9375em;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:0.0625em solid transparent;-webkit-box-shadow:inset 0 0.0625em 0 rgba(255,255,255,.1);box-shadow:inset 0 0.0625em 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:920px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:32.5em}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:12.5em}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-0.9375em;margin-left:-0.9375em}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 0.0625em}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 0.0625em}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:0.0625em 0 0}.navbar-brand{float:left;height:3.125em;padding:0.9375em 0.9375em;font-size:1.125em;line-height:1.25em}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-0.9375em}}.navbar-toggle{position:relative;float:right;padding:0.5625em 0.625em;margin-top:0.5em;margin-right:0.9375em;margin-bottom:0.5em;background-color:transparent;background-image:none;border:0.0625em solid transparent;border-radius:0.25em}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:1.375em;height:0.125em;border-radius:0.0625em}.navbar-toggle .icon-bar+.icon-bar{margin-top:0.25em}@media (min-width:920px){.navbar-toggle{display:none}}.navbar-nav{margin:7.0.3125em -0.9375em}.navbar-nav>li>a{padding-top:0.625em;padding-bottom:0.625em;line-height:1.25em}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:0.3125em 0.9375em 0.3125em 20.3125em}.navbar-nav .open .dropdown-menu>li>a{line-height:1.25em}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:0.9375em;padding-bottom:0.9375em}}.navbar-form{padding:0.625em 0.9375em;margin-top:0.5em;margin-right:-0.9375em;margin-bottom:0.5em;margin-left:-0.9375em;border-top:0.0625em solid transparent;border-bottom:0.0625em solid transparent;-webkit-box-shadow:inset 0 0.0625em 0 rgba(255,255,255,.1),0 0.0625em 0 rgba(255,255,255,.1);box-shadow:inset 0 0.0625em 0 rgba(255,255,255,.1),0 0.0625em 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:0.3125em}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:0.25em;border-top-right-radius:0.25em;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:0.5em;margin-bottom:0.5em}.navbar-btn.btn-sm{margin-top:0.625em;margin-bottom:0.625em}.navbar-btn.btn-xs{margin-top:10.25em;margin-bottom:10.25em}.navbar-text{margin-top:0.9375em;margin-bottom:0.9375em}@media (min-width:768px){.navbar-text{float:left;margin-right:0.9375em;margin-left:0.9375em}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-0.9375em}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:0.5em 0.9375em;margin-bottom:1.25em;list-style:none;background-color:#f5f5f5;border-radius:0.25em}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 0.3125em;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:1.25em 0;border-radius:0.25em}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:0.375em 1.125em;margin-left:-0.0625em;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:0.0625em solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:0.25em;border-bottom-left-radius:0.25em}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:0.25em;border-bottom-right-radius:0.25em}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:0.625em 10.375em;font-size:1.125em;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:0.375em;border-bottom-left-radius:0.375em}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:0.375em;border-bottom-right-radius:0.375em}.pagination-sm>li>a,.pagination-sm>li>span{padding:0.3125em 0.625em;font-size:0.750em;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:0.1875em;border-bottom-left-radius:0.1875em}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:0.1875em;border-bottom-right-radius:0.1875em}.pager{padding-left:0;margin:1.25em 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:0.3125em 10.25em;background-color:#fff;border:0.0625em solid #ddd;border-radius:0.9375em}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-0.0625em}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:0.625em;padding:0.1875em 0.4375em;font-size:0.750em;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:0.625em}.badge:empty{display:none}.btn .badge{position:relative;top:-0.0625em}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:0.0625em 0.3125em}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:0.3125em}.nav-pills>li>a>.badge{margin-left:0.1875em}.jumbotron{padding-top:1.875em;padding-bottom:1.875em;margin-bottom:1.875em;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:0.9375em;font-size:1.313em;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:0.9375em;padding-left:0.9375em;border-radius:0.375em}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:3em;padding-bottom:3em}.container .jumbotron,.container-fluid .jumbotron{padding-right:3.75em;padding-left:3.75em}.jumbotron .h1,.jumbotron h1{font-size:3.938em}}.thumbnail{display:block;padding:0.25em;margin-bottom:1.25em;line-height:1.42857143;background-color:#fff;border:0.0625em solid #ddd;border-radius:0.25em;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:0.5625em;color:#333}.alert{padding:0.9375em;margin-bottom:1.25em;border:0.0625em solid transparent;border-radius:0.25em}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:0.3125em}.alert-dismissable,.alert-dismissible{padding-right:30.3125em}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-0.125em;right:-20.0625em;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:2.5em 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:2.5em 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:2.5em 0}to{background-position:0 0}}.progress{height:1.25em;margin-bottom:1.25em;overflow:hidden;background-color:#f5f5f5;border-radius:0.25em;-webkit-box-shadow:inset 0 0.0625em 0.125em rgba(0,0,0,.1);box-shadow:inset 0 0.0625em 0.125em rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:0.750em;line-height:1.25em;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -0.0625em 0 rgba(0,0,0,.15);box-shadow:inset 0 -0.0625em 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:2.5em 2.5em;background-size:2.5em 2.5em}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:0.9375em}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:625em}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:0.625em}.media-left,.media>.pull-left{padding-right:0.625em}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:0.3125em}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:1.25em}.list-group-item{position:relative;display:block;padding:0.625em 0.9375em;margin-bottom:-0.0625em;background-color:#fff;border:0.0625em solid #ddd}.list-group-item:first-child{border-top-left-radius:0.25em;border-top-right-radius:0.25em}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0.25em;border-bottom-left-radius:0.25em}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:0.3125em}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:1.25em;background-color:#fff;border:0.0625em solid transparent;border-radius:0.25em;-webkit-box-shadow:0 0.0625em 0.0625em rgba(0,0,0,.05);box-shadow:0 0.0625em 0.0625em rgba(0,0,0,.05)}.panel-body{padding:0.9375em}.panel-heading{padding:0.625em 0.9375em;border-bottom:0.0625em solid transparent;border-top-left-radius:0.1875em;border-top-right-radius:0.1875em}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:1em;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:0.625em 0.9375em;background-color:#f5f5f5;border-top:0.0625em solid #ddd;border-bottom-right-radius:0.1875em;border-bottom-left-radius:0.1875em}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:0.0625em 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:0.1875em;border-top-right-radius:0.1875em}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:0.1875em;border-bottom-left-radius:0.1875em}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:0.9375em;padding-left:0.9375em}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:0.1875em;border-top-right-radius:0.1875em}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:0.1875em;border-top-right-radius:0.1875em}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:0.1875em}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:0.1875em}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:0.1875em;border-bottom-left-radius:0.1875em}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:0.1875em;border-bottom-left-radius:0.1875em}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:0.1875em}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:0.1875em}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:0.0625em solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:1.25em}.panel-group .panel{margin-bottom:0;border-radius:0.25em}.panel-group .panel+.panel{margin-top:0.3125em}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:0.0625em solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:0.0625em solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:1.25em;padding:10.5625em;margin-bottom:1.25em;background-color:#f5f5f5;border:0.0625em solid #e3e3e3;border-radius:0.25em;-webkit-box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.05);box-shadow:inset 0 0.0625em 0.0625em rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:20.25em;border-radius:0.375em}.well-sm{padding:0.5625em;border-radius:0.1875em}.close{float:right;font-size:1.313em;font-weight:700;line-height:1;color:#000;text-shadow:0 0.0625em 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:0.625em}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:0.0625em solid #999;border:0.0625em solid rgba(0,0,0,.2);border-radius:0.375em;outline:0;-webkit-box-shadow:0 0.1875em 0.5625em rgba(0,0,0,.5);box-shadow:0 0.1875em 0.5625em rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:0.9375em;border-bottom:0.0625em solid #e5e5e5}.modal-header .close{margin-top:-0.125em}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:0.9375em}.modal-footer{padding:0.9375em;text-align:right;border-top:0.0625em solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:0.3125em}.modal-footer .btn-group .btn+.btn{margin-left:-0.0625em}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9990.5625em;width:3.125em;height:3.125em;overflow:scroll}@media (min-width:768px){.modal-dialog{width:37.5em;margin:1.875em auto}.modal-content{-webkit-box-shadow:0 0.3125em 0.9375em rgba(0,0,0,.5);box-shadow:0 0.3125em 0.9375em rgba(0,0,0,.5)}.modal-sm{width:18.75em}}@media (min-width:990.125em){.modal-lg{width:56.25em}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:0.750em;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:0.3125em 0;margin-top:-0.1875em}.tooltip.right{padding:0 0.3125em;margin-left:0.1875em}.tooltip.bottom{padding:0.3125em 0;margin-top:0.1875em}.tooltip.left{padding:0 0.3125em;margin-left:-0.1875em}.tooltip-inner{max-width:12.5em;padding:0.1875em 0.5em;color:#fff;text-align:center;background-color:#000;border-radius:0.25em}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-0.3125em;border-width:0.3125em 0.3125em 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:0.3125em;bottom:0;margin-bottom:-0.3125em;border-width:0.3125em 0.3125em 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:0.3125em;margin-bottom:-0.3125em;border-width:0.3125em 0.3125em 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-0.3125em;border-width:0.3125em 0.3125em 0.3125em 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-0.3125em;border-width:0.3125em 0 0.3125em 0.3125em;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-0.3125em;border-width:0 0.3125em 0.3125em;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:0.3125em;margin-top:-0.3125em;border-width:0 0.3125em 0.3125em;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:0.3125em;margin-top:-0.3125em;border-width:0 0.3125em 0.3125em;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:270.375em;padding:0.0625em;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:0.875em;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:0.0625em solid #ccc;border:0.0625em solid rgba(0,0,0,.2);border-radius:0.375em;-webkit-box-shadow:0 0.3125em 0.625em rgba(0,0,0,.2);box-shadow:0 0.3125em 0.625em rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-0.625em}.popover.right{margin-left:0.625em}.popover.bottom{margin-top:0.625em}.popover.left{margin-left:-0.625em}.popover-title{padding:0.5em 10.25em;margin:0;font-size:0.875em;background-color:#f7f7f7;border-bottom:0.0625em solid #ebebeb;border-radius:0.3125em 0.3125em 0 0}.popover-content{padding:0.5625em 10.25em}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:10.0625em}.popover>.arrow:after{content:"";border-width:0.625em}.popover.top>.arrow{bottom:-10.0625em;left:50%;margin-left:-10.0625em;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:0.0625em;margin-left:-0.625em;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-10.0625em;margin-top:-10.0625em;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-0.625em;left:0.0625em;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-10.0625em;left:50%;margin-left:-10.0625em;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:0.0625em;margin-left:-0.625em;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-10.0625em;margin-top:-10.0625em;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:0.0625em;bottom:-0.625em;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:62.5em;perspective:62.5em}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:1.250em;color:#fff;text-align:center;text-shadow:0 0.0625em 0.125em rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-0.625em}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-0.625em}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-0.625em}.carousel-control .icon-next,.carousel-control .icon-prev{width:1.25em;height:1.25em;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:0.625em;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:0.625em;height:0.625em;margin:0.0625em;text-indent:-990.5625em;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:0.0625em solid #fff;border-radius:0.625em}.carousel-indicators .active{width:1.125em;height:1.125em;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:1.25em;left:15%;z-index:10;padding-top:1.25em;padding-bottom:1.25em;color:#fff;text-align:center;text-shadow:0 0.0625em 0.125em rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:1.875em;height:1.875em;margin-top:-0.9375em;font-size:1.875em}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-0.9375em}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-0.9375em}.carousel-caption{right:20%;left:20%;padding-bottom:1.875em}.carousel-indicators{bottom:1.25em}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:990.0625em){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:990.0625em){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:990.0625em){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:990.0625em){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:990.125em) and (max-width:1190.5625em){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:990.125em) and (max-width:1190.5625em){.visible-md-block{display:block!important}}@media (min-width:990.125em) and (max-width:1190.5625em){.visible-md-inline{display:inline!important}}@media (min-width:990.125em) and (max-width:1190.5625em){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:990.0625em){.hidden-sm{display:none!important}}@media (min-width:990.125em) and (max-width:1190.5625em){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ diff --git a/app/assets/stylesheets/hnc_cancer_predict.scss b/app/assets/stylesheets/hnc_cancer_predict.scss new file mode 100644 index 0000000..9aec938 --- /dev/null +++ b/app/assets/stylesheets/hnc_cancer_predict.scss @@ -0,0 +1,392 @@ +#cancer_table *[data-key]{ + padding: 0.375em 0; + display: inline-block; + width: 100%; +} +.head_logo{ + height: 4em; +} +.texts_under_result{ + font-weight: bold; + padding-top: 1em; + color: #5d7ca2; +} +th.cancer_th.Treatment { + width: 39%; +} +@media screen and (max-width: 48em){ + .navbar-brand{ + width: 100%; + } +} +div.num_group{ + position: relative; + float: left; + width: 5.125em; + height: 2.25em; + margin-left: 1.125em; +} +@media screen and (min-width: 93.75em){ + .navbar-brand>img.head_logo{ + width: 50%; + height: auto; + } +} +@media screen and (min-width: 48.125em) and (max-width: 93.625em){ + .navbar-brand>img.head_logo{ + width: 70%; + height: auto; + } +} +.header-nav{ + top:0 !important; +} +.title_texts{ + color:rgb(210, 106, 2); + display:none; +} +.cencer_table_name{ + display: inline-block; + vertical-align: middle; + color:#5d7ca2; +} +@media screen and (min-width: 71.125em){ + #cancer_table .cencer_table_name{ + width: 16.25em; + } +} +@media screen and (min-width: 28.375em) and (max-width: 71em){ + #cancer_table .cencer_table_name{ + width: 12.25em; + } +} +@media screen and (max-width: 28.25em){ + #cancer_table .cencer_table_name{ + width: 7em; + } +} +#hnc_cancer_predict_result_block .cencer_table_name{ + width: 5em; +} +.cancer_table_btn{ + margin-right: 0.5em; + color:#5d7ca2; + border-color: #5d7ca2; + font-weight: 600; +} +.cancer_table_btn::last-of-type{ + margin-right:auto; +} +#cancer_table{ + font-size:0.825em; + color:#5d7ca2; +} +#cancer_table_top{ + padding-bottom: 4em; +} +#font_texts{ + padding-right: 0.5em; +} +#text_describe{ + font-weight: bold; + float: left; + max-width: 75%; + padding-bottom: 3em; +} +#font_size_choices{ + font-weight: bold; + float: right; + max-width: 50%; + padding-left:1em; +} +form.for_num{ + position: relative; + float:left; +} +select.select_num{ + position: absolute; + width: 4.3em; + height: 1.75em; + left: 0em; + clip: rect(0.25em, 4.3em, 1.5em,3.3em); + border:none; + padding: 0.5em; +} +input.num_only{ + margin-left: 0; + color: black; + border-top: 0.125em solid rgb(221, 221, 221); + width: 5.125em; + padding: 0em 0em 0.25em; + border-left: 0.125em solid rgb(221, 221, 221); + text-align: center; + font-size: 0.875em; + background-color: rgb(255, 255, 255); + height: 2.25em; + position: absolute; + left: 0; +} +input.float_num{ + position: relative; +} +#cancer_table_left{ + width:100%; +} +#cancer_table_right{ + width:100%; +} +#cancer_table_submit{ + margin-left: 1em; + float: right; + background-color: rgb(210, 105, 0); + color: white; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; +} +#cancer_table_reset{ + float: right; + background-color: rgb(210, 105, 0); + color: white; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; +} +.btn-sub{ + background:url("/assets/hnc_cancer_predict/triangle_sub.png") no-repeat top transparent; + position: relative; + width: 1.875em; + border: 0; + height: 1.875em; + background-size: contain; + top:1em; + bottom: -0.7em; + padding: 0; +} +.btn-add{ + background:url("/assets/hnc_cancer_predict/triangle_add.png") no-repeat top transparent; + position: relative; + width: 1.875em; + border: 0; + height: 1.875em; + background-size: contain; + right: 1.815em; + top: -0.3em; + padding: 0; +} +.cancer_table_btn:focus{ + color: #5d7ca2 !important; + background-color: #9dc3e6 !important; + border-color: #8c8c8c !important; +} +.cancer_table_btn:hover{ + color: #5d7ca2 !important; + background-color: #9dc3e6 !important; + border-color: #8c8c8c !important; +} +.cancer_table_btn.active{ + color: #5d7ca2; + background-color: #9dc3e6; + border-color: #8c8c8c; +} +.cancertable_empty{ + border: 0.25em solid pink !important; + border-radius: 0.5em !important; + padding: 0.125em !important; +} +.result_title{ + background-color: rgb(210, 105, 0); + color: white; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; + float: left; +} +.result_tab{ + background: #023d79; + background: linear-gradient(135deg, transparent 0.3em, #023d79 0); + border: none; + float:right; + padding: 0.5em 0.125em 0.5em 0.5em; + margin-top: 0.5em; + cursor: pointer; +} +#cancer_table a:hover{ + text-decoration: none; + color: #5d7ca2; +} +#result_contents{ + padding-top: 1em; +} +#choice_fields{ + padding: 2em 0 0 calc(20% - 1.625em); +} +.result_tab:hover{ + background: #d16801; + background: linear-gradient(135deg, transparent 0.3em, #d16801 0); + padding: 0.8em 0.125em 0.5em 1em; + margin-left: -0.5em; +} +.result_tab.active{ + background: #d16801; + background: linear-gradient(135deg, transparent 0.3em, #d16801 0); + padding: 0.8em 0.125em 0.5em 1em; + margin-left: -0.5em; +} +.result_tab > a{ + writing-mode: vertical-lr; + -webkit-writing-mode: vertical-lr; + color: white; +} +.result_tab_group{ + width: 15%; + margin: 0; + float: left; +} +.result_content_group{ + width: 85%; + margin: 0; + float: right; +} +.result_content{ + display: none; + min-height: 25em; + border: 0.125em solid #c0cbdd; + padding: 0.5em; +} +.result_content:first-of-type{ + display: block; +} +.result_content a{ + color: #5d7ca2; +} +.result_content p{ + color: #5d7ca2; + clear: both; +} +.cancer_years{ + float:left; + color: #5d7ca2; + background-color: #fff; + border-color: #5d7ca2; + border-width: 0.125em; + margin: 0em; +} +.cancer_years:first-of-type{ + margin-left: 1em; +} +.cancer_years:last-of-type{ + margin-right: 1em; +} +.cancer_form_field{ + margin-left: 1em; +} +#result_table_content a{ + float:left; + display: contents; +} +.result_content span{ + color: #5d7ca2; +} +.hint-texts{ + color: rgb(104, 104, 104); + font-size: 0.75em; + clear: both; + padding: 0.5em 0; +} +#result_text_content a{ + float:left; +} +#result_table_content table{ + clear: both; + width:100%; + table-layout: fixed; + overflow-wrap: break-word; +} +#result_table_content table tbody tr{ + display: none; +} +#result_table_content table tbody tr:first-of-type{ + display: table-row; +} +.white_text,.white_text:link,.white_text:visited{ + color:white; +} +.cancer_th{ + color: white; + background-color: #003d79; + border-right: 0.375em solid white; + border-top: 0.375em solid white; +} +.cancer_td { + background-color: #e9eaf5; + border-right: 0.375em solid white; + border-top: 0.375em solid white; +} +#hnc_cancer_predict_result_block{ + display:none; + font-size: 0.825em; + margin-top: 3em; + border-top: #666 solid; + padding-top: 2em; +} +p.texts_show{ + display: list-item; + margin-left: 1.5em; + clear: both; +} +div.texts_show{ + display: block; + margin-left: 0; +} +.addition{ + display: none; +} +#cancer_table_right_result .cancer_table_btn{ + padding: 0.25em 1em; +} +#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; +} +#hnc_cancer_predict_result{ + width: 80%; +} +@media screen and (min-width: 48em) { + #cancer_table_right{ + float:right; + width:50%; + } + #cancer_table_left{ + float:left; + width:50%; + } + #cancer_table_right_result{ + width: 50%; + float: right; + } + #cancer_table_left_result{ + width: 50%; + float: left; + } + #hnc_cancer_predict_result{ + width: 50%; + float: left; + } + .result_title{ + margin-top: 1em; + } +} +.print_only{ + display: none; +} \ No newline at end of file diff --git a/app/assets/stylesheets/hnc_cancer_predict_print.scss b/app/assets/stylesheets/hnc_cancer_predict_print.scss new file mode 100644 index 0000000..68029ca --- /dev/null +++ b/app/assets/stylesheets/hnc_cancer_predict_print.scss @@ -0,0 +1,402 @@ +@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css); +button, input, optgroup, select, textarea { + margin: 0; + font: inherit; + color: inherit; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + transform: translate(0, 0); +} +.fa-question:before { + content: "\f128"; +} +button { + overflow: visible; +} +button, input, select, textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +#cancer_table *[data-key]{ + padding: 0.375em 0; + display: inline-block; + width: 100%; +} +.head_logo{ + height: 4em; +} +.texts_under_result{ + font-weight: bold; + padding-top: 1em; + color: #5d7ca2; +} +th.cancer_th.Treatment { + width: 39%; +} +div.num_group{ + position: relative; + float: left; + width: 5.125em; + height: 2.25em; + margin-left: 1.125em; +} +.navbar-brand>img.head_logo{ + width: 70%; + height: auto; +} +.header-nav{ + top:0 !important; +} +.title_texts{ + color:rgb(210, 106, 2); + display:none; +} +.cencer_table_name{ + display: inline-block; + vertical-align: middle; + color:#5d7ca2 !important; +} +#cancer_table .cencer_table_name{ + width: 16.25em; +} +#hnc_cancer_predict_result_block .cencer_table_name{ + width: 5em; +} +.cancer_help_btn{ + background-color: rgb(210, 106, 2) !important; + border-color: rgb(210, 106, 2) !important; + color: white !important; +} +.cancer_help_btn i:before { + color: white !important; +} +.cancer_table_btn{ + margin-right: 0.5em; + color:#5d7ca2 !important; + border-color: #5d7ca2 !important; + font-weight: 600; +} +.cancer_table_btn::last-of-type{ + margin-right:auto; +} +#cancer_table{ + font-size:0.825em; + color:#5d7ca2; +} +@media print{ +#cancer_table_top{ + padding-bottom: 4em; +} +#font_texts{ + padding-right: 0.5em; +} +#text_describe{ + font-weight: bold; + float: left; + max-width: 75%; + padding-bottom: 3em; +} +#font_size_choices{ + font-weight: bold; + float: right; + max-width: 50%; + padding-left:1em; +} +form.for_num{ + position: relative; + float:left; +} +select.select_num{ + position: absolute; + width: 4.3em; + height: 1.75em; + left: 0em; + clip: rect(0.25em, 4.3em, 1.5em,3.3em); + border:none; + padding: 0.5em; +} +input.num_only{ + margin-left: 0; + color: black; + border-top: 0.125em solid rgb(221, 221, 221); + width: 5.125em; + padding: 0em 0em 0.25em; + border-left: 0.125em solid rgb(221, 221, 221); + text-align: center; + font-size: 0.875em; + background-color: rgb(255, 255, 255) !important; + height: 2.25em; + position: absolute; + left: 0; +} +input.float_num{ + position: relative; +} +#cancer_table_left{ + width:100%; +} +#cancer_table_right{ + width:100%; +} +#cancer_table_submit{ + margin-left: 1em; + float: right; + background-color: rgb(210, 105, 0) !important; + color: white !important; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; +} +#cancer_table_reset{ + float: right; + background-color: rgb(210, 105, 0) !important; + color: white !important; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; +} +.btn-sub{ + background:url("/assets/hnc_cancer_predict/triangle_sub.png") no-repeat top transparent; + position: relative; + width: 1.875em; + border: 0; + height: 1.875em; + background-size: contain; + top:1em; + bottom: -0.7em; + padding: 0; +} +.btn-add{ + background:url("/assets/hnc_cancer_predict/triangle_add.png") no-repeat top transparent; + position: relative; + width: 1.875em; + border: 0; + height: 1.875em; + background-size: contain; + right: 1.815em; + top: -0.3em; + padding: 0; +} +.cancer_table_btn:focus{ + color: #5d7ca2 !important; + background-color: #9dc3e6 !important; + border-color: #8c8c8c !important; +} +.cancer_table_btn:hover{ + color: #5d7ca2 !important; + background-color: #9dc3e6 !important; + border-color: #8c8c8c !important; +} +.cancer_table_btn.active{ + color: #5d7ca2 !important; + background-color: #9dc3e6 !important; + border-color: #8c8c8c !important; +} +.cancertable_empty{ + border: 0.25em solid pink !important; + border-radius: 0.5em !important; + padding: 0.125em !important; +} +.result_title{ + background-color: rgb(210, 105, 0) !important; + color: white !important; + border: 0em; + padding: 0.125em 0.5em; + border-radius: 0.5em; + font-size: 1.25em; + float: left; +} +.result_tab{ + background: #023d79 !important; + background: linear-gradient(135deg, transparent 0.3em, #023d79 0) !important; + border: none; + float:right; + padding: 0.5em 0.125em 0.5em 0.5em; + margin-top: 0.5em; + cursor: pointer; +} +#cancer_table a:hover{ + text-decoration: none; + color: #5d7ca2; +} +#result_contents{ + padding-top: 1em; +} +#choice_fields{ + padding: 2em 0 0 calc(20% - 1.625em); +} +.result_tab:hover{ + background: #d16801; + background: linear-gradient(135deg, transparent 0.3em, #d16801 0); + padding: 0.8em 0.125em 0.5em 1em; + margin-left: -0.5em; +} +.result_tab.active{ + background: #d16801 !important; + background: linear-gradient(135deg, transparent 0.3em, #d16801 0) !important; + padding: 0.8em 0.125em 0.5em 1em; + margin-left: -0.5em; +} +.result_tab > a{ + writing-mode: vertical-lr !important; + -webkit-writing-mode: vertical-lr !important; + color: white !important; +} +.result_tab_group{ + display: none; +} +.result_content_group{ + width: 100%; + margin: 0; + float: none; +} +.result_content{ + display: block; + min-height: 25em; + border: 0.125em solid #c0cbdd !important; + padding: 0.5em; +} +.result_content:first-of-type{ + display: block; +} +.result_content a{ + color: #5d7ca2; +} +.result_content span{ + color: #5d7ca2; +} +.result_content p{ + color: #5d7ca2; + clear: both; +} +.cancer_years{ + float:left; + color: #5d7ca2; + background-color: #fff; + border-color: #5d7ca2; + border-width: 0.125em; + margin: 0em; +} +.cancer_years:first-of-type{ + margin-left: 1em; +} +.cancer_years:last-of-type{ + margin-right: 1em; +} +.cancer_form_field{ + margin-left: 1em; +} +#result_table_content a{ + float:left; + display: contents; +} +.hint-texts{ + color: rgb(104, 104, 104); + font-size: 0.75em; + clear: both; + padding: 0.5em 0; +} +#result_text_content a{ + float:left; +} +#result_table_content table{ + clear: both; + width:100%; + table-layout: fixed; + overflow-wrap: break-word; +} +#result_table_content table tbody tr{ + display: none; +} +#result_table_content table tbody tr:first-of-type{ + display: table-row; +} +.white_text,.white_text:link,.white_text:visited{ + color:white; +} +.cancer_th{ + color: white !important; + background-color: #003d79 !important; + border-right: 0.375em solid white; + border-top: 0.375em solid white; +} +.cancer_td { + background-color: #e9eaf5 !important; + border-right: 0.375em solid white; + border-top: 0.375em solid white; +} +#hnc_cancer_predict_result_block{ + display:none; + font-size: 0.825em; + margin-top: 3em; + border-top: #666 solid; + padding-top: 2em; +} +p.texts_show{ + display: list-item; + margin-left: 1.5em; + clear: both; +} +div.texts_show{ + display: block; + margin-left: 0; +} +.addition{ + display: none; +} +#cancer_table_right_result .cancer_table_btn{ + padding: 0.25em 1em; +} +#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; +} +#hnc_cancer_predict_result{ + width: 80%; +} +#cancer_table_right{ + float:right; + width:50%; +} +#cancer_table_left{ + float:left; + width:50%; +} +#cancer_table_right_result{ + width: 50%; + float: right; +} +#cancer_table_left_result{ + width: 50%; + float: left; +} +#hnc_cancer_predict_result{ + width: 50%; + float: left; +} +.result_title{ + margin-top: 1em; +} +* { + -webkit-print-color-adjust: exact !important; +} +.layout-content{ + background: #fff !important; +} +} \ No newline at end of file diff --git a/app/controllers/.keep b/app/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/admin/hnc_cancer_predicts_controller.rb b/app/controllers/admin/hnc_cancer_predicts_controller.rb new file mode 100644 index 0000000..a0e125c --- /dev/null +++ b/app/controllers/admin/hnc_cancer_predicts_controller.rb @@ -0,0 +1,743 @@ +# encoding: utf-8 +class Admin::HncCancerPredictsController < OrbitAdminController + require "spreadsheet" + require "rubyXL" + require "fileutils" + require "axlsx" + require "csv" + #include Admin::HncCancerPredictsHelper + before_action ->(module_app = @app_title) { set_variables module_app } + before_action :create_first_field + helper Admin::HncCancerPredictsHelper + #before_action :load_access_levels + def initialize + super + @app_title = "hnc_cancer_predict" + end + + def yaml_load(v) + YAML.load(v) + end + + def titleize(v) + if v.is_a?(String) + if v.match(/[ \t]*\d/) + v + else + v.titleize + end + else + v.to_s + end + end + + def index + @tags = @module_app.tags + @categories = @module_app.categories.enabled + @filter_fields = filter_fields(@categories, @tags) + @table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified] + @hnc_head_images_id = @form_to_show.hnc_head_images_id + @title_images_id = @form_to_show.title_images_id + @hnc_head_images = [] + @title_images = [] + @hnc_head_images_id.each { |image_id| @hnc_head_images.push HncHeadimages.find_by(:id => image_id.to_s) } rescue nil + @title_images_id.each { |image_id| @title_images.push HncHeadimages.find_by(:id => image_id.to_s) } rescue nil + @head_new_image = HncHeadimages.new(:hnc_cancer_predictfields_id => @form_to_show.id) + end + + def edit + other_in_use_locales = Site.first.in_use_locales.map { |l| l.to_s } + other_in_use_locales.delete(params[:locale]) + if !(params["hnc_cancer_predictfields"].nil?) + if !(params["hnc_cancer_predictfields"]["form_show"].nil?) + params["hnc_cancer_predictfields"]["form_show"].each do |num, property| + property.each do |key, value| + if key.include?("_file") && (!value[:temp_file].blank? rescue false) + if value[:id].nil? + mapping_file = HncCancerPredictMappingFile.create(value) + else + mapping_file = HncCancerPredictMappingFile.find(value[:id]) + mapping_file.temp_file = value[:temp_file] + mapping_file.save + end + @form_to_show.form_show[num.to_s][key.to_s] = mapping_file.id + elsif key.include?("_file") + if value[:_destroy] == "1" + mapping_file = HncCancerPredictMappingFile.find(value[:id]) + mapping_file.destroy + @form_to_show.form_show[num.to_s][key.to_s] = "" + end + end + next if key.include?("_file") + if (key != "old_num") + if key != params[:locale] + @form_to_show.form_show[num.to_s] = {} if @form_to_show.form_show[num.to_s].nil? + type = HncCancerPredictfields::FIELDINFO[key.to_s] + if type && HncCancerPredictfields::Field_relations[type] + type = HncCancerPredictfields::Field_relations[type] + end + type = type.constantize rescue String + if type != Array + if type == Fixnum + @form_to_show.form_show[num.to_s][key.to_s] = value.to_i rescue 0 + elsif type == Float + @form_to_show.form_show[num.to_s][key.to_s] = value.to_f rescue 0.0 + else + @form_to_show.form_show[num.to_s][key.to_s] = value + end + else + if value.length > 2 + @form_to_show.form_show[num.to_s][key.to_s] = yaml_load(value) + else + @form_to_show.form_show[num.to_s][key.to_s] = [] + end + end + else + value.each do |sub_property, sub_value| + type = HncCancerPredictfields::FIELDINFO[sub_property.to_s] + if type && HncCancerPredictfields::Field_relations[type] + type = HncCancerPredictfields::Field_relations[type] + end + type = type.constantize rescue String + @form_to_show.form_show[num.to_s][sub_property] = {} if @form_to_show.form_show[num.to_s][sub_property].nil? + if type != Array + if type == Fixnum + @form_to_show.form_show[num.to_s][sub_property][params[:locale].to_s] = sub_value.to_i rescue 0 + elsif type == Float + @form_to_show.form_show[num.to_s][sub_property][params[:locale].to_s] = sub_value.to_f rescue 0.0 + else + @form_to_show.form_show[num.to_s][sub_property][params[:locale].to_s] = sub_value + end + else + if sub_value.length > 2 + puts [num, sub_property] + @form_to_show.form_show[num.to_s][sub_property][params[:locale].to_s] = yaml_load(sub_value) + else + @form_to_show.form_show[num.to_s][sub_property][params[:locale].to_s] = [] + end + end + if (property["old_num"].present? && property["old_num"] != num.to_s) + other_in_use_locales.each do |locale| + @form_to_show.form_show[num.to_s][sub_property][locale] = @form_to_show.form_show_was[property["old_num"]][sub_property][locale] + end + end + end + end + end + end + end + org_nums = @form_to_show.form_show_was.keys + remain_org_nums = params["hnc_cancer_predictfields"]["form_show"].values.map { |property| property["old_num"] }.select { |n| n.present? } + delete_nums = org_nums - remain_org_nums + if !delete_nums.blank? + delete_nums.each do |delete_num| + @form_to_show.form_show.delete(delete_num) + end + end + @form_to_show.form_show = @form_to_show.form_show.values.map.with_index { |v, i| [i.to_s, v] }.to_h + else + @form_to_show.form_show = {} + end + if !params["hnc_cancer_predictfields"]["form_show_in_result"].nil? + params["hnc_cancer_predictfields"]["form_show_in_result"].each do |num, property| + property.each do |key, value| + if key.include?("_file") && (!value[:temp_file].blank? rescue false) + if value[:id].nil? + mapping_file = HncCancerPredictMappingFile.create(value) + else + mapping_file = HncCancerPredictMappingFile.find(value[:id]) + mapping_file.temp_file = value[:temp_file] + mapping_file.save + end + @form_to_show.form_show[num.to_s][key.to_s] = mapping_file.id + elsif key.include?("_file") + if value[:_destroy] == "1" + mapping_file = HncCancerPredictMappingFile.find(value[:id]) + mapping_file.destroy + @form_to_show.form_show_in_result[num.to_s][key.to_s] = "" + end + end + next if key.include?("_file") + if (key != "old_num") + if key != params[:locale] + @form_to_show.form_show_in_result[num.to_s] = {} if @form_to_show.form_show_in_result[num.to_s].nil? + type = HncCancerPredictfields::FIELDINFO[key.to_s] + if type && HncCancerPredictfields::Field_relations[type] + type = HncCancerPredictfields::Field_relations[type] + end + type = type.constantize rescue String + if type != Array + if type == Fixnum + @form_to_show.form_show_in_result[num.to_s][key.to_s] = value.to_i rescue 0 + elsif type == Float + @form_to_show.form_show_in_result[num.to_s][key.to_s] = value.to_f rescue 0.0 + else + @form_to_show.form_show_in_result[num.to_s][key.to_s] = value + end + else + if value.length > 2 + @form_to_show.form_show_in_result[num.to_s][key.to_s] = yaml_load(value) + else + @form_to_show.form_show_in_result[num.to_s][key.to_s] = [] + end + end + else + value.each do |sub_property, sub_value| + type = HncCancerPredictfields::FIELDINFO[sub_property.to_s] + if type && HncCancerPredictfields::Field_relations[type] + type = HncCancerPredictfields::Field_relations[type] + end + type = type.constantize rescue String + @form_to_show.form_show_in_result[num.to_s][sub_property] = {} if @form_to_show.form_show_in_result[num.to_s][sub_property].nil? + if type != Array + if type == Fixnum + @form_to_show.form_show_in_result[num.to_s][sub_property][params[:locale].to_s] = sub_value.to_i rescue 0 + elsif type == Float + @form_to_show.form_show_in_result[num.to_s][sub_property][params[:locale].to_s] = sub_value.to_f rescue 0.0 + else + @form_to_show.form_show_in_result[num.to_s][sub_property][params[:locale].to_s] = sub_value + end + else + if sub_value.length > 2 + @form_to_show.form_show_in_result[num.to_s][sub_property][params[:locale].to_s] = yaml_load(sub_value) + else + @form_to_show.form_show_in_result[num.to_s][sub_property][params[:locale].to_s] = [] + end + end + if (property["old_num"].present? && property["old_num"] != num.to_s) + other_in_use_locales.each do |locale| + @form_to_show.form_show_in_result[num.to_s][sub_property][locale] = @form_to_show.form_show_was[property["old_num"]][sub_property][locale] + end + end + end + end + end + end + end + org_nums = @form_to_show.form_show_in_result_was.keys + remain_org_nums = params["hnc_cancer_predictfields"]["form_show_in_result"].values.map { |property| property["old_num"] }.select { |n| n.present? } + delete_nums = org_nums - remain_org_nums + if !delete_nums.blank? + delete_nums.each do |delete_num| + @form_to_show.form_show_in_result.delete(delete_num) + end + end + @form_to_show.form_show_in_result = @form_to_show.form_show_in_result.values.map.with_index { |v, i| [i.to_s, v] }.to_h + else + @form_to_show.form_show_in_result = {} + end + @create_items = ["title_texts", "form_result_is_right", "text_descibe", "years", "table_above_texts", "text_above_texts", "surgery_only_texts", "extra_texts", "extra_therapy_texts", "danger_texts", "texts_between_Result_and_result_block", "prediction_formula", "hidden_variables", "advance_mode", "years_settings"] + params_cancer = params.require("hnc_cancer_predictfields").permit! + @create_items.each do |item| + if (@form_to_show[item].class == BSON::Document) || (@form_to_show.send(item).class == Hash) + item_hash = @form_to_show[item] + item_hash = item_hash.merge(params_cancer[item]) + @form_to_show[item] = item_hash + elsif @form_to_show[item].class == Array + if params_cancer[item].class != Array + @form_to_show[item] = yaml_load(params_cancer[item]) rescue [] + else + @form_to_show[item] = params_cancer[item] + end + @form_to_show[item] = [] if @form_to_show[item].class != Array + else + @form_to_show[item] = params_cancer[item] + end + end + @size = ["small", "medium", "large"] + @size.each { |size| @form_to_show[size] = params["hnc_cancer_predictfields"][size].to_h } + @file_path = Rails.root.to_s + "/app/assets/images/predict_tool" + if !Dir.exist? @file_path + FileUtils.mkdir_p @file_path + end + @images = params["hnc_cancer_predictfields"]["hnc_head_images"] + @hnc_head_images_id = @form_to_show.hnc_head_images_id + @delete_index = [] + if !@images.nil? + @images.each do |num, image| + if num.to_i < @hnc_head_images_id.length && @hnc_head_images_id.length != 0 + if image["remove_image"] == "1" + @delete_index.push num.to_i + else + @image_id = @hnc_head_images_id[num.to_i] + @image = HncHeadimages.find_by(:id => @image_id.to_s) + if !image["sort_number"].nil? + @image.sort_number = image["sort_number"].to_i + @image.save + end + next if image["temp_file"] == nil + @file_name = image["temp_file"].original_filename.gsub("(", "_").gsub(")", "_").gsub(" ", "_") rescue next + @image.sort_number = image["sort_number"].to_i + @image.temp_file = image["temp_file"] + @image.save + end + else + @file_name = image["temp_file"].original_filename.gsub("(", "_").gsub(")", "_").gsub(" ", "_") rescue next + @hnc_headimages = HncHeadimages.new(:hnc_cancer_predictfields_id => @form_to_show.id, :title => @app_title + "hnc_head_images") + @hnc_headimages.temp_file = image["temp_file"] + @hnc_headimages.sort_number = image["sort_number"].to_i if !image["sort_number"].nil? + @hnc_headimages.save + @form_to_show.hnc_head_images_id.push @hnc_headimages.id + end + end + end + @delete_index.reverse! + @delete_index.each do |i| + @image_id = @hnc_head_images_id[i.to_i] + HncHeadimages.find_by(:id => @image_id).destroy rescue next + @form_to_show.hnc_head_images_id.delete(@image_id) + end + @images = params["hnc_cancer_predictfields"]["title_images"] + @title_images_id = @form_to_show.title_images_id + @delete_index = [] + if !@images.nil? + @images.each do |num, image| + if num.to_i < @title_images_id.length && @title_images_id.length != 0 + if image["remove_image"] == "1" + @delete_index.push num.to_i + else + @image_id = @title_images_id[num.to_i] + @image = HncHeadimages.find_by(:id => @image_id.to_s) + if !image["sort_number"].nil? + @image.sort_number = image["sort_number"].to_i + @image.save + end + next if image["temp_file"] == nil + @file_name = image["temp_file"].original_filename.gsub("(", "_").gsub(")", "_").gsub(" ", "_") rescue next + @image.sort_number = image["sort_number"].to_i + @image.temp_file = image["temp_file"] + @image.save + end + else + @file_name = image["temp_file"].original_filename.gsub("(", "_").gsub(")", "_").gsub(" ", "_") rescue next + @hnc_headimages = HncHeadimages.new(:hnc_cancer_predictfields_id => @form_to_show.id, :title => @app_title + "title_images") + @hnc_headimages.temp_file = image["temp_file"] + @hnc_headimages.sort_number = image["sort_number"].to_i if !image["sort_number"].nil? + @hnc_headimages.save + @form_to_show.title_images_id.push @hnc_headimages.id + end + end + end + @delete_index.reverse! + @delete_index.each do |i| + @image_id = @title_images_id[i.to_i] + HncHeadimages.find_by(:id => @image_id).destroy rescue next + @form_to_show.title_images_id.delete(@image_id) + end + file_ids = (@form_to_show.form_show.values + @form_to_show.form_show_in_result.values).map { |property| [property[:variable], property[:hnc_cancer_predict_mapping_file]] }.select { |k, f| f.present? }.to_h + mapping_data_from_csv = {} + if !file_ids.blank? + file_ids.each do |k, v| + mapping_data_from_csv[k] = read_mapping_file(v) + end + end + @form_to_show.mapping_data_from_csv = mapping_data_from_csv.to_json + @form_to_show.save + fork do + @form_to_show.auto_write_predict_js + end + end + @index = 0 + Dir.chdir("public") do + while File.exist?("cancerfield_back" + @index.to_s + ".txt") + @index += 1 + end + end + Dir.chdir("public") do + @site_locales = Site.last.in_use_locales.each do |locale| + I18n.with_locale(locale) do + @file_tmp = File.new(HncCancerPredictfields::ToolTableMap[I18n.locale], "w") + tmp_table_texts = create_table(locale) + @file_tmp.write(tmp_table_texts) + @file_tmp.close + end + end + end + Dir.chdir("public") do + @file_back = File.open("cancerfield_back" + @index.to_s + ".txt", "w") + @file_back.write(@form_to_show.attributes) + @file_back.close + @file_org = File.open("cancerfield_org" + @index.to_s + ".txt", "w") + @file_org.write(HncCancerPredictfields.where("title" => @app_title + "_back").first.attributes) + @file_org.close + end + redirect_to admin_hnc_cancer_predicts_path + end + + def create_table(current_locale) + create_first_field + current_site = Site.last + @size = {} + @size_name = ["small", "medium", "large"] + @size_name.each { |name| @size[name] = @form_to_show[name]["font_size"] } + @size_active_size = "" + @size.each { |size_key, size_value| (@form_to_show[size_key]["active"].to_i == 1) ? (@size_active_size = size_value) : nil } + @table_str = '
' + @table_str += '
' + @form_to_show.text_descibe[current_locale] + "
" + @table_str += '
' + '" + @size.each { |size_key, size_value| @table_str += ('") } + @table_str += '
' + @table_str_left = '
' + @table_str_right = '
' + @form_to_show.form_show.each do |num, property| + @field_property = {} + property.each do |key, value| + @value = value + @disp_value + if @value.class == BSON::Document || @value.class == Hash + @disp_value = @value[current_locale] rescue "" + else + @disp_value = @value + end + @disp_value = "" if @disp_value.nil? + @field_property[key] = @disp_value + end + if @field_property["right"] == 0 + next if @field_property["name"].blank? + @table_str_left += "
" + @table_str_left += '" + if @field_property["comment_text"].present? + @table_str_left += '' + @table_str_left += '' + @table_str_left += '
' + end + end + if @field_property["is_num"] == 1 + if @field_property["is_float"] == 1 + @table_str_left += '
' + else + if @field_property["range"] == [] + @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 + end + else + @table_str_left += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_left += '" + @table_str_left += '' + end + @table_str_left += "
" + end + if @field_property["hint"].to_s != "" + @table_str_left += '
' + @field_property["hint"] + "
" + end + @table_str_left += '
' + else + @table_str_right += "
" + break if @field_property["name"] == "" + @table_str_right += '" + if @field_property["comment_text"].present? + @table_str_right += '' + @table_str_right += '' + @table_str_right += '
' + end + end + if @field_property["is_num"] == 1 + if @field_property["is_float"] == 1 + @table_str_right += '
' + else + if @field_property["range"] == [] + @table_str_left += '
' + else + @table_str_right += '
' + @table_str_right += '' + @table_str_right += '' + @please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice" + @table_str_right += '
" + end + end + else + @table_str_right += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_right += '" + @table_str_right += '' + end + @table_str_right += "
" + end + if @field_property["hint"].to_s != "" + @table_str_right += '
' + @field_property["hint"] + "
" + end + @table_str_right += '
' + end + end + @table_str_left += "
" + @table_str_right += "
" + @table_str += (@table_str_left + @table_str_right) + @table_str += '
' + @table_result_str = '
' + t("hnc_cancer_predict.table.result").to_s + '
' + @tab_name = ["table", "text"] + @table_result_str += '
' + @form_to_show.texts_between_Result_and_result_block[current_locale] + "
" + @table_result_str += '
' + @tab_name.each_with_index { |name, index| @table_result_str += ('
') } + @table_result_str += '
' + @tab_name.each { |name| @table_result_str += '" } + @table_result_str += "
" + @table_button = '
' + @submit_btn_str = '" + @reset_btn_str = '" + @table_button += (@submit_btn_str + @reset_btn_str + '
') + @table_result_choice_fileds = '
' if @form_to_show.form_result_is_right == 1 + @table_result_choice_fileds = '
' if @form_to_show.form_result_is_right == 0 + @table_result_choice_fileds += '' + t("hnc_cancer_predict.table.Therapy_choice").to_s + '
' + @table_result_choice_fileds += '
' + @form_to_show.form_show_in_result.each do |num, property| + @field_property = {} + property.each do |key, value| + @value = value + if @value.class == BSON::Document || @value.class == Hash + @disp_value = @value[current_locale.to_s] rescue "" + else + @disp_value = @value + end + @disp_value = "" if @disp_value.nil? + @field_property[key] = @disp_value + end + @table_result_choice_fileds += "
" + break if @field_property["name"] == "" + @table_result_choice_fileds += '" + if @field_property["comment_text"].present? + @table_result_choice_fileds += '' + @table_result_choice_fileds += '' + @table_result_choice_fileds += '
' + end + end + if @field_property["is_num"] == 1 + if @field_property["is_float"] == 1 + @table_result_choice_fileds += '
' + else + if @field_property["range"] == [] + @table_str_left += '
' + else + @table_result_choice_fileds += '
' + @table_result_choice_fileds += '
' + @table_str_left += '' + @please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice" + @table_result_choice_fileds += '
" + end + end + else + @table_result_choice_fileds += '
' + @field_property["choice_fields"].each do |create_choice| + @table_result_choice_fileds += '" + @table_result_choice_fileds += '' + end + @table_result_choice_fileds += "
" + end + if @field_property["hint"].to_s != "" + @table_result_choice_fileds += '
' + @field_property["hint"] + "
" + end + @table_result_choice_fileds += '
' + end + @table_result_choice_fileds += "
" + @table_str += (@table_button + '
' + @table_result_str + @table_result_choice_fileds + "
" + '
') + return @table_str + end + + def showSubmit + @page_num = params[:page] || 1 + @results = HncCancerPredictrecord.where("title" => @app_title).desc(:id).page(@page_num).per(10) + @variables = [] + @names = [] + @form_to_show.form_show.each do |num, property| + property.each do |key, value| + if key == "variable" + @variables.push value + elsif key == "name" + @names.push value[I18n.locale.to_s] + end + end + end + @result_variables = [] + @result_names = [] + @indexs = [] + @choicenames = [] + if @results.length != 0 + @results[0].result.each { |key, value| @result_variables.push key } rescue nil + @result_variables.each do |variable| + @index = @variables.index(variable.to_s) + @result_names.push @names[@index] if !@index.nil? + @indexs.push @index if !@index.nil? + end + @indexs.each do |index| + if @form_to_show.form_show[index.to_s]["is_num"] == 1 || @form_to_show.form_show[index.to_s]["is_float"] == 1 + @choicenames.push "" + else + @choicenames.push @form_to_show.form_show[index.to_s]["choice_fields"][I18n.locale.to_s] + end + end + end + @pagination = create_pagination(@page_num.to_i) + end + + def export_cancer_tool_record + cancer_records = HncCancerPredictrecord.where("title" => @app_title).desc(:id) + dir_path = "tmp/cancer_tool/" + #FileUtils.rm_r(dir_path, :force => true) if Dir.exist?(dir_path) + FileUtils.mkdir dir_path if !Dir.exist?(dir_path) #create dir for storing tmp_file if dir doesn't exist + @filename = ("#{Time.now.year}_%02s_%02s_export_cancer_tool_record.xlsx" % [Time.now.month, Time.now.day]).gsub(" ", "0") + Dir.chdir(dir_path) do + File.open(@filename, "w") do |f| + f.write render_to_string(:handlers => [:axlsx], :formats => [:xlsx], :partial => "export_cancer_tool_record.xlsx", :locals => { :results => cancer_records }) + end + end + tmp_filename_data = File.read(dir_path + @filename) + send_data(tmp_filename_data, type: "application/xlsx", disposition: "attachment", filename: @filename) + end + + def create_first_field + if HncCancerPredictfields.where("title" => (@app_title + "_back")).take_while { true }.count == 0 + @form_to_show = HncCancerPredictfields.new() + @form_to_show.title = @app_title + "_back" + @form_to_show.save + end + @form_to_show + if HncCancerPredictfields.where("title" => @app_title).take_while { true }.count == 0 + @form_to_show = HncCancerPredictfields.new() + @form_to_show.title = @app_title + @form_to_show.save + @form_to_show = HncCancerPredictfields.where("title" => @app_title).first + Dir.chdir("public") do + @site_locales = Site.last.in_use_locales.each do |locale| + I18n.with_locale(locale) do + @file_tmp = File.new(HncCancerPredictfields::ToolTableMap[I18n.locale], "w") + tmp_table_texts = create_table(locale) + @file_tmp.write(tmp_table_texts) + @file_tmp.close + end + end + end + else + @form_to_show = HncCancerPredictfields.where("title" => @app_title).first + end + end + + def create_pagination(page = 1, fields = HncCancerPredictrecord.all, extra_params = "") + page = 1 if page == 0 + per_page_num = 10.0 + all_page_num = (fields.count / per_page_num).ceil + all_page_num = 1 if all_page_num == 0 + pagination = '
' + ((I18n.locale.to_s == "zh_tw") ? "第 #{page} 頁" : "page #{page}") + "/" + ((I18n.locale.to_s == "zh_tw") ? "共 #{all_page_num} 頁" : "Total #{all_page_num} page(s)") + '
    ' + + ((page == 1) ? "
  1. [" + I18n.t("hnc_cancer_predict.prev_page") + "]
  2. " : '
  3. [' + I18n.t("hnc_cancer_predict.prev_page") + "]
  4. ") + if all_page_num > 7 + if page <= (all_page_num / 2) + if page <= 7 + (1..page).to_a.each { |page_num| pagination += ((page_num == page) ? "
  5. [" + page_num.to_s + "]
  6. " : '
  7. ' + page_num.to_s + "
  8. ") } + else + (1..3).to_a.each { |page_num| pagination += ((page_num == page) ? "
  9. [" + page_num.to_s + "]
  10. " : '
  11. ' + page_num.to_s + "
  12. ") } + pagination += "
  13. ...
  14. " + (page - 3..page).to_a.each { |page_num| pagination += ((page_num == page) ? "
  15. [" + page_num.to_s + "]
  16. " : '
  17. ' + page_num.to_s + "
  18. ") } + end + (page + 1..page + 3).to_a.each { |page_num| pagination += ((page_num == page) ? "
  19. [" + page_num.to_s + "]
  20. " : '
  21. ' + page_num.to_s + "
  22. ") } + pagination += "
  23. ...
  24. " + (all_page_num - 2..all_page_num).to_a.each { |page_num| pagination += ((page_num == page) ? "
  25. [" + page_num.to_s + "]
  26. " : '
  27. ' + page_num.to_s + "
  28. ") } + else + (1..3).to_a.each { |page_num| pagination += ((page_num == page) ? "
  29. [" + page_num.to_s + "]
  30. " : '
  31. ' + page_num.to_s + "
  32. ") } + pagination += "
  33. ...
  34. " + (page - 3..page).to_a.each { |page_num| pagination += ((page_num == page) ? "
  35. [" + page_num.to_s + "]
  36. " : '
  37. ' + page_num.to_s + "
  38. ") } + if all_page_num - page <= 7 + (page + 1..all_page_num).to_a.each { |page_num| pagination += ((page_num == page) ? "
  39. [" + page_num.to_s + "]
  40. " : '
  41. ' + page_num.to_s + "
  42. ") } + else + (page + 1..page + 3).to_a.each { |page_num| pagination += ((page_num == page) ? "
  43. [" + page_num.to_s + "]
  44. " : '
  45. ' + page_num.to_s + "
  46. ") } + pagination += "
  47. ...
  48. " + (all_page_num - 2..all_page_num).to_a.each { |page_num| pagination += ((page_num == page) ? "
  49. [" + page_num.to_s + "]
  50. " : '
  51. ' + page_num.to_s + "
  52. ") } + end + end + else + (1..all_page_num).to_a.each { |page_num| pagination += ((page_num == page) ? "
  53. [" + page_num.to_s + "]
  54. " : '
  55. ' + page_num.to_s + "
  56. ") } + end + pagination += (((page == all_page_num) ? "
  57. [" + I18n.t("hnc_cancer_predict.next_page") + "]
  58. " : '
  59. [' + I18n.t("hnc_cancer_predict.next_page") + "]
  60. ") + "
") + end + + def read_mapping_file(mapping_file_id) + mapping_file = HncCancerPredictMappingFile.find(mapping_file_id) rescue nil + if !mapping_file.nil? + csv_rows = CSV.read(mapping_file.temp_file.file.path) + titles = csv_rows[0] + infos = {} + titles.each_with_index do |title, i| + infos[title] = [] + csv_rows[1..-1].each do |row| + infos[title] << row[i].to_f + end + end + return infos + else + return {} + end + end +end diff --git a/app/controllers/hnc_cancer_predicts_controller.rb b/app/controllers/hnc_cancer_predicts_controller.rb new file mode 100644 index 0000000..b4dd7ba --- /dev/null +++ b/app/controllers/hnc_cancer_predicts_controller.rb @@ -0,0 +1,232 @@ +# encoding: utf-8 +require "rubyXL" +require "json" + +class HncCancerPredictsController < ApplicationController + def initialize + super + @app_title = "hnc_cancer_predict" + end + + def calculate + begin + create_first_field + if params["header"].to_i == 1 + locale = params["locale"].to_s rescue "zh_tw" + locale = "zh_tw" if locale == "zh_cn" + result = {} + @hnc_head_images = {} + @form_to_show.hnc_head_images_id.each do |image_id| + next if image_id.to_s == "" + @image = HncHeadimages.find_by(:id => image_id.to_s) + @url = @image.temp_file.to_s + @hnc_head_images[@image.sort_number.to_i] = ('') + end + result["hnc_head_images"] = Hash[@hnc_head_images.sort].values.join("") + @hnc_head_images = {} + @form_to_show.title_images_id.each do |image_id| + next if image_id.to_s == "" + @image = HncHeadimages.find_by(:id => image_id.to_s) + @url = @image.temp_file.to_s + @hnc_head_images[@image.sort_number.to_i] = ('') + end + result["danger_texts"] = (@form_to_show.danger_texts[locale] rescue "") + result["title"] = Hash[@hnc_head_images.sort].values.join("") + result["page_title"] = @form_to_show.title_texts[params[:locale]] + elsif params["get_mapping_data_from_csv"].to_i == 1 + result = {} + result["mapping_data_from_csv"] = JSON.parse(@form_to_show.mapping_data_from_csv) rescue {} + else + @record = HncCancerPredictrecord.new + @record.title = @app_title + @choice_keys = [] + @choice_values = [] + @choice_names = [] + @form_to_show.form_show.values.each { |choice| @choice_keys.push choice[:variable] } + @form_to_show.form_show.values.each { |choice| @choice_values.push ((choice[:is_num] == 1) ? [] : choice[:choice_fields]) } + @form_to_show.form_show.values.each { |choice| @choice_names.push choice[:name] } + @choice_keys.each_with_index { |key, i| @record.names[key] = @choice_names[i] } + @choice_keys.each_with_index { |key, i| @record.values[key] = @choice_values[i] } + params["data"].each do |rec_key, rec_value| + @record.result[rec_key] = rec_value + end + @record.submit_time = Time.now.to_s + @record.save + locale = params["data"]["locale"].to_s rescue "zh_tw" + locale = "zh_tw" if locale == "zh_cn" + result = {} + mapping_data_from_csv = JSON.parse(@form_to_show.mapping_data_from_csv) rescue {} + @form_to_show.all_variables.each do |v| + result[v] = 0 + end + @form_to_show.form_show.each do |num, property| + @variable = property[:variable] + if @variable.present? + if property[:is_num] == 1 + if property[:is_float] == 1 + result[@variable] = params["data"][@variable].to_f rescue 0.0 + else + result[@variable] = params["data"][@variable].to_i rescue 0 + end + elsif property[:choice_fields].present? + if !(@form_to_show.advance_mode) + result[@variable] = params["data"][@variable].to_i rescue 0 + else + if property[:need_map_values] == 1 + result[@variable] = property[:map_values][params["data"][@variable].to_i - 1] + else + if property[:revert_value] != 1 + result[@variable] = params["data"][@variable].to_i - 1 + else + result[@variable] = ((property[:choice_fields].length - params["data"][@variable].to_i) rescue params["data"][@variable].to_i) + end + end + end + end + if @form_to_show.advance_mode && property[:hnc_cancer_predict_mapping_file].present? + if (mapping_data_from_csv != {}) + mapping_hash = mapping_data_from_csv[@variable] + temp_index = 0 + temp_value = result[@variable] + mapping_hash.each_with_index do |(k, v), i| + if i == 0 + index_val = v.index(temp_value) rescue nil + if !index_val.nil? + temp_index = index_val + else + closest_value = v.min_by { |x| (temp_value - x).abs } + temp_index = v.index(closest_value) + end + end + result[k] = v[temp_index] + end + end + end + end + end + formula_variables = @form_to_show.tmp_lpv_variables + begin + eval_hidden_variables(result) + rescue => e + @form_to_show.generate_eval_formula + eval_hidden_variables(result) + end + begin + eval_formula(result) + rescue => e + @form_to_show.generate_eval_formula + eval_formula(result) + end + result["lpv"] = result[formula_variables.last] + result["lpv_variable"] = {} + formula_variables.each do |variable_name| + result["lpv_variable"]["#{variable_name}"] = result[variable_name] + end + @years = @form_to_show.years + result["years"] = @years + @therapy_choices = [I18n.t("hnc_cancer_predict.table.Surgeryonly")] + @form_to_show.form_show_in_result.values.each { |choice| @therapy_choices.push choice["name"][locale] } + @therapy_names = @form_to_show.treatment_method + result["treatment_method"] = @therapy_names + result["treatment_method_active_indices"] = @form_to_show.treatment_method_active_indices + result["table"] = @form_to_show.result_table_translations[locale] + year = params["data"]["year"] rescue nil + if year.nil? + year = @years.last.to_f + else + year = year.to_f + end + year_index = @years.index(year) + @servive_ratio = eval(@form_to_show.tmp_years_settings_for_ruby[year_index]) + @servive_ratio = (@servive_ratio * 100).round(2) + result["texts"] = @form_to_show.result_text_translations[locale] + result["extra_therapy_texts"] = @form_to_show.extra_therapy_texts[locale] rescue @form_to_show.extra_therapy_texts["zh_tw"] + result["servive_ratio"] = @servive_ratio + end + result = result.merge(params) + render :json => result + rescue => e + puts [e.to_s, e.backtrace] + raise e + end + end + + def index + uid = OrbitHelper.params[:uid] rescue "" + tags = OrbitHelper.widget_tags + categories = OrbitHelper.widget_categories || [] + @table_str = File.read(HncCancerPredictfields::ToolTableMap[I18n.locale]) + preidct_js_url = "/assets/hnc_cancer_predict.js" + if File.exist?(HncCancerPredictfields::JSFileName) + js_filename = File.read(HncCancerPredictfields::JSFileName) + if js_filename.include?("hnc_cancer_predict.js") + asset = Rails.application.assets[js_filename] + preidct_js_url = "#{Rails.application.config.assets.prefix}/#{asset.digest_path}" + else + preidct_js_url = "#{Rails.application.config.assets.prefix}/#{File.basename(js_filename)}" + end + end + { + "hnc_cancer_predict" => [], + "extras" => { "table" => @table_str, "preidct_js_url" => preidct_js_url }, + } + end + + def widget + uid = OrbitHelper.params[:uid] rescue "" + tags = OrbitHelper.widget_tags + categories = OrbitHelper.widget_categories || [] + @table_str = File.read(HncCancerPredictfields::ToolTableMap[I18n.locale]) + preidct_js_url = "/assets/hnc_cancer_predict.js" + if File.exist?("public/cancer_tool_js_filename.txt") + js_filename = File.read("public/cancer_tool_js_filename.txt") + if js_filename.match("hnc_cancer_predict.js") + asset = Rails.application.assets[js_filename] + preidct_js_url = "#{Rails.application.config.assets.prefix}/#{asset.digest_path}" + else + preidct_js_url = "#{Rails.application.config.assets.prefix}/#{File.basename(js_filename)}" + end + end + { + "hnc_cancer_predict" => [], + "extras" => { "table" => @table_str, "preidct_js_url" => preidct_js_url }, + } + end + + def create_first_field + if HncCancerPredictfields.where("title" => (@app_title + "_back")).count == 0 + @form_to_show = HncCancerPredictfields.new() + @form_to_show.title = @app_title + "_back" + @form_to_show.save + end + @form_to_show + if HncCancerPredictfields.where("title" => @app_title).count == 0 + @form_to_show = HncCancerPredictfields.new() + @form_to_show.title = @app_title + @form_to_show.save + @form_to_show = HncCancerPredictfields.where("title" => @app_title).first + else + @form_to_show = HncCancerPredictfields.where("title" => @app_title).first + end + end + + def read_mapping_file(mapping_file) + if mapping_file.class != HncCancerPredictMappingFile + mapping_file = HncCancerPredictMappingFile.find(mapping_file_id) rescue nil + end + if !mapping_file.nil? + csv_rows = CSV.read(mapping_file.temp_file.file.path) + titles = csv_rows[0] + infos = {} + titles.each_with_index do |title, i| + infos[title] = [] + csv_rows[1..-1].each do |row| + infos[title] << row[i].to_f + end + end + return infos + else + return {} + end + end +end diff --git a/app/helpers/.keep b/app/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/admin/hnc_cancer_predicts_helper.rb b/app/helpers/admin/hnc_cancer_predicts_helper.rb new file mode 100644 index 0000000..bab5cfd --- /dev/null +++ b/app/helpers/admin/hnc_cancer_predicts_helper.rb @@ -0,0 +1,46 @@ +module Admin::HncCancerPredictsHelper + def hnc_yaml_dump(arr) + if arr.blank? + '[]' + elsif arr.class != String + '[' + arr.map{|s| (s.is_a?(String) && !(s.is_i?) && s.include?(' ')) ? "\"#{s}\"" : s}.join(', ') + ']' + else + arr + end + end + def create_pagination(page=1,fields=HncCancerPredictrecord.all,extra_params="") + page = 1 if page == 0 + per_page_num = 10.0 + all_page_num = (fields.count / per_page_num).ceil + pagination = '
'+((I18n.locale.to_s == 'zh_tw') ? "第 #{page} 頁" : "page #{page}") +'/'+ ((I18n.locale.to_s == 'zh_tw') ? "共 #{all_page_num} 頁" : "Total #{all_page_num} page(s)")+'
    '+ + ((page == 1) ? '
  1. ['+I18n.t('hnc_cancer_predict.prev_page')+']
  2. ' : '
  3. ['+I18n.t('hnc_cancer_predict.prev_page')+']
  4. ') + if all_page_num > 7 + if page <= (all_page_num / 2) + if page <= 7 + (1..page).to_a.each{|page_num| pagination += ((page_num == page) ? '
  5. ['+page_num.to_s+']
  6. ' : '
  7. '+page_num.to_s+'
  8. ')} + else + (1..3).to_a.each{|page_num| pagination += ((page_num == page) ? '
  9. ['+page_num.to_s+']
  10. ' : '
  11. '+page_num.to_s+'
  12. ')} + pagination +='
  13. ...
  14. ' + (page-3..page).to_a.each{|page_num| pagination += ((page_num == page) ? '
  15. ['+page_num.to_s+']
  16. ' : '
  17. '+page_num.to_s+'
  18. ')} + end + (page+1..page+3).to_a.each{|page_num| pagination += ((page_num == page) ? '
  19. ['+page_num.to_s+']
  20. ' : '
  21. '+page_num.to_s+'
  22. ')} + pagination +='
  23. ...
  24. ' + (all_page_num-2..all_page_num).to_a.each{|page_num| pagination += ((page_num == page) ? '
  25. ['+page_num.to_s+']
  26. ' : '
  27. '+page_num.to_s+'
  28. ')} + else + (1..3).to_a.each{|page_num| pagination += ((page_num == page) ? '
  29. ['+page_num.to_s+']
  30. ' : '
  31. '+page_num.to_s+'
  32. ')} + pagination +='
  33. ...
  34. ' + (page-3..page).to_a.each{|page_num| pagination += ((page_num == page) ? '
  35. ['+page_num.to_s+']
  36. ' : '
  37. '+page_num.to_s+'
  38. ')} + if all_page_num - page <= 7 + (page+1..all_page_num).to_a.each{|page_num| pagination += ((page_num == page) ? '
  39. ['+page_num.to_s+']
  40. ' : '
  41. '+page_num.to_s+'
  42. ')} + else + (page+1..page+3).to_a.each{|page_num| pagination += ((page_num == page) ? '
  43. ['+page_num.to_s+']
  44. ' : '
  45. '+page_num.to_s+'
  46. ')} + pagination +='
  47. ...
  48. ' + (all_page_num-2..all_page_num).to_a.each{|page_num| pagination += ((page_num == page) ? '
  49. ['+page_num.to_s+']
  50. ' : '
  51. '+page_num.to_s+'
  52. ')} + end + end + else + (1..all_page_num).to_a.each{|page_num| pagination += ((page_num == page) ? '
  53. ['+page_num.to_s+']
  54. ' : '
  55. '+page_num.to_s+'
  56. ')} + end + pagination += (((page==all_page_num) ? '
  57. ['+I18n.t('hnc_cancer_predict.next_page')+']
  58. ' : '
  59. ['+I18n.t('hnc_cancer_predict.next_page')+']
  60. ')+'
') + end +end diff --git a/app/models/.keep b/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/hnc_cancer_predict_mapping_file.rb b/app/models/hnc_cancer_predict_mapping_file.rb new file mode 100644 index 0000000..e407b9b --- /dev/null +++ b/app/models/hnc_cancer_predict_mapping_file.rb @@ -0,0 +1,10 @@ +# encoding: utf-8 +class HncCancerPredictMappingFile + include Mongoid::Document + include Mongoid::Timestamps + mount_uploader :temp_file, HncHeadImagesUploader + + def file_identifier + filename = self.temp_file.file.original_filename rescue "" + end +end \ No newline at end of file diff --git a/app/models/hnc_cancer_predictfields.rb b/app/models/hnc_cancer_predictfields.rb new file mode 100644 index 0000000..ac15464 --- /dev/null +++ b/app/models/hnc_cancer_predictfields.rb @@ -0,0 +1,491 @@ +class HncCancerPredictfields + require "pathname" + require 'json' + include Mongoid::Document + include Mongoid::Timestamps + Field_relations = {"number_field"=>"Fixnum","text_area"=>"String"} + FIELDINFO = {"variable"=>"String","name"=>"String","is_num"=>"Fixnum","hint"=>"String","comment_text"=>"String","choice_fields"=>"Array","range"=>"Array","right"=>"Fixnum","is_float"=>"Fixnum","revert_value"=>"Fixnum","map_values"=>"Array","hnc_cancer_predict_mapping_file"=>"String","lpv_impact"=>"Float","active_choice"=>"number_field","disable_condition"=>"text_area"} + NonLoclaized = ["variable","is_num","range","right","is_float","revert_value","map_values","hnc_cancer_predict_mapping_file","lpv_impact","active_choice","disable_condition"] + AdvanceFields = ["revert_value","map_values","hnc_cancer_predict_mapping_file"] + TherapyFields = ["variable","name","hint","comment_text","choice_fields","lpv_impact","active_choice","disable_condition"] + TherapyOnly = ["lpv_impact","active_choice","disable_condition"] + JSFileName = "public/hnc_tool_js_filename.txt".freeze + ToolTableMap = I18n.available_locales.map do |locale| + [locale, "public/hnc_tool_table_tmp_#{locale}.txt".freeze] + end.to_h + field :title ,type:String ,default:"" + field :advance_mode, type: Boolean, default: false + field :form_show , :type=> Hash ,default:{ + "0"=>{"variable"=>"age", "name"=>{"zh_tw"=>"年齡
(Age)", "en"=>"Age"}, "is_num"=>1, "hint"=>{"zh_tw"=>"從 20 歲(含)開始至 80 歲", "en"=>"Age must be between 20 and 80"}, "comment_text"=>{"zh_tw"=>"年齡為該病人於確診罹患頭頸癌時之年齡", "en"=>"Age at diagnosis"}, "choice_fields"=>{"zh_tw"=>[], "en"=>[]}, "range"=>[20, 80], "right"=>0, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "1"=>{"variable"=>"size", "name"=>{"zh_tw"=>"腫瘤大小(單位:mm)
(Tumor size)", "en"=>"Tumor size"}, "is_num"=>1, "hint"=>{"zh_tw"=>"", "en"=>"The unit of tumor size is millimeter (mm)"}, "comment_text"=>{"zh_tw"=>"若有多個原發腫瘤,請輸入最大尺寸之原發腫瘤、上限為 100mm", "en"=>"If there was more than one primary tumor, please enter the size of the largest one."}, "choice_fields"=>{"zh_tw"=>[], "en"=>[]}, "range"=>[1, 100], "right"=>0, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "2"=>{"variable"=>"height", "name"=>{"zh_tw"=>"身高(單位:公分)
(Height)", "en"=>"Height(cm)"}, "is_num"=>1, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"", "en"=>""}, "choice_fields"=>{"zh_tw"=>[], "en"=>[]}, "range"=>[140, 200], "right"=>0, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "3"=>{"variable"=>"weight", "name"=>{"zh_tw"=>"體重(單位:公斤)
(Weight)", "en"=>"Weight(kg)"}, "is_num"=>1, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"", "en"=>""}, "choice_fields"=>{"zh_tw"=>[], "en"=>[]}, "range"=>[40, 130], "right"=>0, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "4"=>{"variable"=>"pstage", "name"=>{"zh_tw"=>"病理分期
(Pathological stage)", "en"=>"Pathological stage"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"若無分期資訊,請選擇“未知”選項,將以分期第 1 期進行預測。", "en"=>"Please select “unknown” if there is no information about “Pathological stage”. The prediction model would use “1th stage” as the alternative variable."}, "choice_fields"=>{"zh_tw"=>["1", "2", "3", "4", "未知"], "en"=>["1", "2", "3", "4", "unknown"]}, "range"=>[], "right"=>0, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "5"=>{"variable"=>"sex", "name"=>{"zh_tw"=>"性別
(Sex)", "en"=>"Sex"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"", "en"=>""}, "choice_fields"=>{"zh_tw"=>["男", "女"], "en"=>["Male", "Female"]}, "range"=>[], "right"=>1, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "6"=>{"variable"=>"site", "name"=>{"zh_tw"=>"腫瘤部位
(Tumor site)", "en"=>"Tsumor site"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"", "en"=>""}, "choice_fields"=>{"zh_tw"=>["口腔", "口咽", "下咽", "唾液腺", "喉"], "en"=>["Oral cavity", "Oropharynx", "Hypopharynx", "Salivary glands", "Larynx"]}, "range"=>[], "right"=>1, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "7"=>{"variable"=>"lymph", "name"=>{"zh_tw"=>"被侵犯頸部淋巴結之最大直徑
(Maximum lymph node diameter)", "en"=>"Maximum lymph node diameter"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"此請填入被侵犯頸部淋巴結紀錄中之最大徑,若無頸部淋巴結被侵犯資訊,請選擇“未知”選項,將以無侵犯類別進行預測。", "en"=>"Please fill in the maximum lymph node diameter here. If there is no information about this, please select the “Unknown” option, and prediction will be made as no metastasis."}, "choice_fields"=>{"zh_tw"=>["無侵犯", "1-9 mm", "10-19 mm", "20-29 mm", "30-39 mm", "40-49 mm", "50-59 mm", ">= 60 mm", "未知"], "en"=>["No metastasis", "1-9 mm", "10-19 mm", "20-29 mm", "30-39 mm", "40-49 mm", "50-59 mm", ">= 60 mm", "unknown"]}, "range"=>[], "right"=>1, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "8"=>{"variable"=>"drinking", "name"=>{"zh_tw"=>"喝酒行為
(Alcohol consumption)", "en"=>"Alcohol consumption"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"請依據診斷日前一年內喝酒行為填入。", "en"=>"Please fill in the information based on your drinking behavior within one year before this diagnosis."}, "choice_fields"=>{"zh_tw"=>["從未喝酒", "偶爾喝", "習慣性喝酒"], "en"=>["Never", "Sometime", "Usually"]}, "range"=>[], "right"=>1, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]}, + "9"=>{"variable"=>"smoking", "name"=>{"zh_tw"=>"吸菸行為
(Tobacco smoking)", "en"=>"Tobacco smoking"}, "is_num"=>0, "hint"=>{"zh_tw"=>"", "en"=>""}, "comment_text"=>{"zh_tw"=>"請依據診斷日前一年內吸菸行為填入。", "en"=>"Please fill in the information based on your smoking behavior within one year before this diagnosis."}, "choice_fields"=>{"zh_tw"=>["沒有", "有"], "en"=>["No", "Yes"]}, "range"=>[], "right"=>1, "is_float"=>0, "need_map_values"=>0, "revert_value"=>0, "map_values"=>[]} + } + field :form_show_in_result , :type=> Hash ,default: { + "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"=>[], "right"=>0, "is_float"=>0, "revert_value"=>0, "map_values"=>"", "active_choice"=>2, "disable_condition"=>"", "lpv_impact"=>0.15613}, + "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"=>[], "right"=>0, "is_float"=>0, "revert_value"=>0, "map_values"=>"", "active_choice"=>2, "disable_condition"=>"", "lpv_impact"=>-0.34129} + } + field :form_result_is_right , :type=> Integer ,default: 0 + field :text_descibe ,type:Hash ,default: { + "zh_tw"=>"歡迎使用台灣準備頭頸癌預後系統!
\r\n本預測系統由台灣癌症登記資料庫2013至2018年間共49,137位頭頸癌病人所建立。
\r\n若要開始 請在下方選擇相關資訊", + "en"=>"Welcome to the Taiwan Head and Neck Cancer Prediction System!
\r\nThe prediction system is constructed using clinical data from 49,137 head and neck cancer patients in the Taiwan Cancer Registry database between 2013 to 2018.
\r\nTo start, please select the information below." + } + field :small ,type:Hash ,default:{'font_size'=>"0.825em",'active'=>0} + field :medium ,type:Hash ,default:{'font_size'=>"1em",'active'=>1} + field :large ,type:Hash ,default:{'font_size'=>"1.25em",'active'=>0} + field :hnc_head_images_id ,type:Array , default: [] + field :title_images_id ,type:Array , default: [] + field :title_texts ,type:Hash ,default: {"zh_tw"=>"頭頸癌症線上預測工具", "en"=>"Predict Head and Neck Cancer Tool"} + field :table_above_texts ,type:Hash ,default: {"zh_tw"=>"下表之分析為針對手術後病人,根據選定的術後治療,分別估計在第1年、3 及5年的存活率。", "en"=>"The analysis is for women who had undergone surgery.The table shows the 1-, 3- and 5-year survival rates,based on the treatment you have selected."} + field :text_above_texts ,type:Hash ,default: {"zh_tw"=>"此研究分析來自已接受根除性手術後之婦女所得之結果,根據您所輸入的資訊以及治療方式,在術後
第{{years}}年,", "en"=>"The analysis is for women who had undergone surgery. Base on the information and the treatment you have selected, the predictions of survival status
{{years}}"} + field :surgery_only_texts ,type:Hash ,default: {"zh_tw"=>"100 位只接受根除性手術的婦女中,有{{Surgery_only}}位婦女,術後{{surgery_year}}年仍為存活", "en"=>"after surgery are as follows:
{{Surgery_only}} out of 100 women treated with surgery only are alive at {{surgery_year}} years."} + field :extra_texts ,type:Hash ,default: {"zh_tw"=>",此外", "en"=>""} + field :extra_therapy_texts ,type:Hash ,default: {"zh_tw"=>"100 位在術後有接受{{extra_therapy}}的婦女中,有{{survival_num}}位婦女,術後{{surgery_year}}年仍為存活(多了{{Additional_Benefit}}位)", "en"=>"{{survival_num}} out of 100 women treated with {{extra_therapy}} are alive (an extra {{Additional_Benefit}})"} + field :danger_texts ,type:Hash ,default: {"zh_tw"=>"請注意紅框的輸入資料是否符合要求!", "en"=>"Please check whether input data in red blocks are correct!"} + field :years ,type:Array ,default:[1,3,5] + field :texts_between_Result_and_result_block ,type:Hash ,default: {"zh_tw"=>"如果欲將預測結果應用於臨床上,請務必與您的主治醫師討論後再做最後決定。化學治療為高期數頭頸癌常規治療,本係數估計會有失真現象,請謹慎使用並考慮干擾因子效應。", "en"=>"Please note that the patients need to consult with their medical doctors before making any decision.As chemotherapy is the standard treatment of high grade head and neck cancer patients, the estimation of the coefficient in chemotherapy may be biased. Please be careful about the interpretation of the results and seriouly consider the confounding factors."} + #field :image_uploader ,type:Object + field :prediction_formula , type: String ,default: "lpv = ((age-56.13649)*0.00542+(size-26.24087)*0.01555+(bmi-24.71561)*(-0.03777)+ + pstage_2*0.22023+pstage_3*0.11253+pstage_4*0.74585+ + sex_ind*(-0.29218)+site_oralph*0.15131+site_hyph*(-0.18040)+site_sal*(-0.32440)+site_lary*(-0.19674)+ + lymph_1*0.69354+lymph_2*0.85665+lymph_3*0.92695+lymph_4*0.93122+lymph_5*0.72533+ + lymph_6*1.12371+lymph_7*1.13236+drink_ind*0.12961+smoke_ind*(-0.17848)+chemo*(0.15613)+radio*(-0.34129) +)" + field :years_settings , type: Array , default: ["exp(-0.03639284)^( exp(lpv) )","exp(-0.08738490)^( exp(lpv) )","exp(-0.10683094)^( exp(lpv) )"] + field :tmp_years_settings , type: Array , default: [] + field :tmp_years_settings_for_ruby , type: Array , default: [] + field :hidden_variables, type: String, default: "bmi = weight / ((height / 100.0) ^ 2) + pstage_2 = (pstage == 2) ? 1 : 0 + pstage_3 = (pstage == 3) ? 1 : 0 + pstage_4 = (pstage == 4) ? 1 : 0 + sex_ind = (sex == 2) ? 1 : 0 + site_oralph = (site == 2) ? 1 : 0 + site_hyph = (site == 3) ? 1 : 0 + site_sal = (site == 4) ? 1 : 0 + site_lary = (site == 5) ? 1 : 0 + lymph_1 = (lymph == 2) ? 1 : 0 + lymph_2 = (lymph == 3) ? 1 : 0 + lymph_3 = (lymph == 4) ? 1 : 0 + lymph_4 = (lymph == 5) ? 1 : 0 + lymph_5 = (lymph == 6) ? 1 : 0 + lymph_6 = (lymph == 7) ? 1 : 0 + lymph_7 = (lymph == 8) ? 1 : 0 + drink_ind = (drinking == 1) ? 0 : 1 + smoke_ind = (smoking == 1) ? 0 : 1 + chemo = (Chemotherapy == 2) ? 1 : 0 + radio = (Radiotherapy == 2) ? 1 : 0 + " + field :fix_hidden_variables, type: Array, default: [] + field :tmp_hidden_variables_for_ruby, type: String, default: "" + field :tmp_hidden_variables_for_js, type: String, default: "" + field :lpv_calc, type: Hash, default: {} #for js code + field :tmp_lpv_ruby_code, type: String, default: "" + field :tmp_lpv_variables, type: Array, default: [] + field :mapping_data_from_csv , type: String ,default: "" + field :all_variables, type: Array, default: [] + field :treatment_method, type: Array, default: ['Surgery_only'] + field :treatment_method_active_indices, type: Array, default: [1] + field :result_table, type: String, default: "", localize: true + field :result_text, type: String, default: "", localize: true + field :therapy_lpv, type: Array, default: [0] + #before_create :set_expire + before_save do + self.form_show.each do |num,property| + property[:need_map_values] = (property[:map_values].class == Array && property[:choice_fields].class == Array && property[:map_values].length == property[:choice_fields].length) ? 1 : 0 + end + result_keys = [] + self.form_show.each do |num,property| + variable_name = property[:variable] + if variable_name.present? + result_keys << variable_name + end + end + self.form_show_in_result.each do |num,property| + variable_name = property[:variable] + if variable_name.present? + result_keys << variable_name + end + end + mapping_data = JSON.parse(self.mapping_data_from_csv) rescue {} + if self.advance_mode && mapping_data.present? + mapping_data.each do |k,v| + result_keys += (v.keys rescue []) + end + end + result_keys = result_keys.uniq + self.all_variables = result_keys + formula = text_to_math(self.prediction_formula) + tmp_hidden_variables = text_to_math(self.hidden_variables) + result_keys.each do |k| + formula = formula.gsub(/(\A|[^\w])#{k}($|[^\w])/){|f| "#{$1}result[\"#{k.strip}\"]#{$2}" } + tmp_hidden_variables = tmp_hidden_variables.gsub(/(\A|[^\w])#{k}($|[^\w])/){|f| "#{$1}result[\"#{k.strip}\"]#{$2}" } + end + self.tmp_hidden_variables_for_js = tmp_hidden_variables.rstrip.gsub(/\n\s+/,"\n ").gsub("\n",";\n") + ";" + self.fix_hidden_variables = [] + self.tmp_hidden_variables_for_ruby = tmp_hidden_variables.split(/^([^=!]+)=([^=!])/).select{|s| s.present?}.each_slice(2).map do |a,b| + a = a.strip + self.fix_hidden_variables << a + if b + ("result[\"#{a}\"]=" + b.gsub("\n","")) + else + a + end + end.join("\n") + self.fix_hidden_variables = self.fix_hidden_variables.uniq + formula = formula.split(/^([^=!]+)=([^=!])/).select{|s| s.present?}.each_slice(2).map do |a,b| + a = a.strip + if b + ("result[\"#{a}\"]=" + b.gsub("\n","")) + else + a + end + end.join("\n") + self.fix_hidden_variables.each do |v| + formula = formula.gsub(/(\A|[^\w\"])#{v}($|[^\w])/){|f| "#{$1}result[\"#{v.strip}\"]#{$2}"} + self.tmp_hidden_variables_for_ruby = self.tmp_hidden_variables_for_ruby.gsub(/(\A|[^\w\"])#{v}($|[^\w])/){|f| "#{$1}result[\"#{v.strip}\"]#{$2}"} + end + self.tmp_lpv_ruby_code = formula + formula_variables = formula.enum_for(:scan,/([^\=\(\)]+)?=[^=]/).map {|x| x[-1] }.compact.map{|s| s.strip[8..-3]} + self.tmp_lpv_variables = formula_variables + self.tmp_years_settings = self.years_settings.map do |s| + text_to_math(s) + end + self.tmp_years_settings_for_ruby = self.tmp_years_settings.clone + formula_variables.each do |variable_name| + self.tmp_years_settings_for_ruby = self.tmp_years_settings_for_ruby.map do |y| + y.gsub(variable_name,"result[\"#{variable_name}\"]") + end + end + self.treatment_method = ['Surgery_only'] + self.form_show_in_result.values.each do |choice| + variable = choice["variable"] + if variable.present? + self.treatment_method << variable + end + end + tmp_table_translations = {} + tmp_text_translations = {} + @years = self.years + @head_name = ['Treatment','Additional_Benefit','Overall_Survival'] + # @head_name = ['Treatment','Overall_Survival'] + @therapy_names = self.treatment_method + I18n.available_locales.each do |locale| + I18n.with_locale(locale) do + @table_head = @head_name.map{|name| I18n.t('hnc_cancer_predict.table.'+name)} + @therapy_choices = [I18n.t('hnc_cancer_predict.table.Surgeryonly')] + self.form_show_in_result.values.each{|choice| @therapy_choices.push choice["name"][locale].to_s} + tmp_table = "#{I18n.t("hnc_cancer_predict.table.table")}
" + tmp_table += '

'+self.table_above_texts[locale].to_s+'

' + tmp_table += (''+(locale.to_s == 'zh_tw' ? '第' : '')+'') + @years.each{|year| tmp_table += ('')} + tmp_table += (''+(locale == 'zh_tw' ? '年' : '')+'') + tmp_table += '' + @table_head.each_with_index{|head,index| tmp_table += ('')} + tmp_table += '' + @therapy_choices.each_with_index do |choice,i| + tmp_table += '' + @table_head.each_with_index do |head,index| + tmp_table += ('') + end + tmp_table += '' + end + tmp_table_translations[locale] = tmp_table + @texts = self.text_above_texts[locale].to_s.gsub('
','
').gsub('{{Surgery_only}}','') + @texts = @texts.split('{{years}}') + @texts.delete('') + tmp_text = "#{I18n.t("hnc_cancer_predict.table.text")}
" + tmp_text += (''+@texts[0].to_s) + @years.each{|year| tmp_text += ('')} + if @texts.count > 1 + tmp_text += (@texts[1]+'') if @texts.count > 1 + else + tmp_text += '
' + end + if !self.surgery_only_texts[locale].blank? + @surgery_only_texts = self.surgery_only_texts[locale] + @surgery_only_texts.insert(0,'

') + @surgery_only_texts = @surgery_only_texts.gsub('{{Surgery_only}}','') + @surgery_only_texts = @surgery_only_texts.gsub('{{surgery_year}}',''+@years[-1].to_s+'') + @surgery_only_texts += '' + else + @surgery_only_texts = '' + end + tmp_text += @surgery_only_texts + tmp_text += ''+(self.extra_texts[locale].to_s rescue '')+'

' + tmp_text_translations[locale] = tmp_text + end + end + self.result_table_translations = tmp_table_translations + self.result_text_translations = tmp_text_translations + self.treatment_method_active_indices = [1] + self.form_show_in_result.each do |num, property| + v = property[:active_choice] + if v.present? + self.treatment_method_active_indices << (v - 1) + else + self.treatment_method_active_indices << 1 + end + end + self.lpv_calc = get_years_settings_dict + self.generate_eval_formula + end + def reload_any_asset(path, type=nil, force_reload=false) + env = Rails.application.assets + new_env = Sprockets::Environment.new(Rails.root.to_s) do |env| + env.version = ::Rails.env + tmp_path = "#{Rails.application.config.root}/tmp/cache/assets/#{::Rails.env}" + env.cache = ::Sprockets::Cache::FileStore.new(tmp_path) + env.context_class.class_eval do + include ::Sprockets::Rails::Helper + end + end + new_env.config = env.config + stats = env.cached.instance_variable_get(:@stats) + new_path = path.sub(/\.erb$/,'') + if force_reload || (stats && stats[path]) #Need reload asset + if type.nil? + ext = File.extname(new_path) + env.mime_types.each do |t, h| + if h[:extensions].include?(ext) + type = t + break + end + end + end + if type + full_path = 'file://'+path+'?type='+type + uris = env.cached.instance_variable_get(:@uris) + keys = uris.keys.select{|k| k.include?(full_path)} + asset = new_env.load(full_path) + if keys.count != 0 + keys.each do |k| + uris[k] = asset + end + end + new_path = new_path.sub(/\.[^.]+$/){|ext| '-' + asset.digest + ext} + File.binwrite(new_path, asset.to_s) + yield new_path if block_given? + end + end + end + def reload_js_asset(path, force_reload=false) + reload_any_asset(path, 'application/javascript', force_reload) do |new_path| + File.open(JSFileName, 'w+'){|f| f.write(new_path)} + end + end + def generate_eval_formula + eval_hidden_variables = "def eval_hidden_variables(result); #{self.tmp_hidden_variables_for_ruby}; end" + HncCancerPredictsController.module_eval(eval_hidden_variables) + eval_formula = "def eval_formula(result); #{self.tmp_lpv_ruby_code}; end" + HncCancerPredictsController.module_eval(eval_formula) + end + def generate_jscode + js_code = "var map_values , mapping_hash , temp_index ,temp_value , index , closest_value;\r\n" + mapping_data_from_csv = JSON.parse(self.mapping_data_from_csv) rescue {} + tmp_hash = self.form_show.values + self.form_show_in_result.values + tmp_hash.each do |property| + @variable = property[:variable] + if @variable.present? + if property[:is_num] == 1 + js_code += " result['#{@variable}'] = Number(result_json['#{@variable}']);\r\n" + elsif property[:choice_fields].present? + if !(self.advance_mode) + js_code += " result['#{@variable}'] = Number(result_json['#{@variable}']);\r\n" + else + if property[:need_map_values] == 1 + js_code += " map_values = #{property[:map_values]};\r\n" + js_code += " result['#{@variable}'] = map_values[Number(result_json['#{@variable}'']) - 1];\r\n" + else + if property[:revert_value] != 1 + js_code += " result['#{@variable}'] = Number(result_json['#{@variable}']) - 1;\r\n" + else + js_code += " result['#{@variable}'] = (#{property[:choice_fields].length} - Number(result_json['#{@variable}']));\r\n" + end + end + end + end + if self.advance_mode && property[:hnc_cancer_predict_mapping_file].present? + if (mapping_data_from_csv != {} && !mapping_data_from_csv[@variable].blank?) + js_code += " mapping_hash = mapping_data_from_csv['#{@variable}'];\r\n" + js_code += " temp_index = 0;\r\n" + js_code += " temp_value = result['#{@variable}'];\r\n" + js_code += " index = 0; + $.each(mapping_hash,function(k,v){ + if( index == 0 ){ + var index_val = v.indexOf(temp_value); + if( index_val != -1 ){ + temp_index = index_val; + }else{ + closest_value = v.get_nearest_value(temp_value); + temp_index = v.indexOf(closest_value) + } + } + result[k] = v[temp_index]; + index++; + });\r\n" + end + end + end + end + js_code += "\n Object.keys(result).forEach(function(k){ + if(Number.isNaN(result[k])){ + result[k] = 0; + } + })" + js_code += "\n #{self.tmp_hidden_variables_for_js}" + formula = text_to_math(self.prediction_formula) + self.all_variables.each do |k| + formula = formula.gsub(/(\A|[^\w])#{k}($|[^\w])/){|f| "#{$1}result[\"#{k.strip}\"]#{$2}" } + end + formula_variables = self.tmp_lpv_variables.map{|v| v} + js_code = "\n function calculate_first_lpv(result_json){ + result = {}; + #{js_code} + try{ + #{formula.gsub(/\s{2,10}/," ").gsub("\n","\n ")} + }catch(e){console.log(e)}; + result['lpv_variable'] = {}; + #{formula_variables.map{|v| "result['lpv_variable']['#{v}'] = #{v};"}.join("\n ") } + result['lpv'] = #{formula_variables.count == 0 ? 0 : formula_variables.last}; + result['lpv_variable']['lpv'] = result['lpv']; + return result; + }; + function calculate_and_change_result_value(obj){ + obj.servive_ratio_arr = []; + for(var i = 0;i{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc],[:postdate, :desc])} + scope :is_approved, ->{where(:approved => true)} + before_save :set_submit_times + def set_submit_times + self.submit_time = HncCancerPredictrecord.all.count + 1 + end + def check_missing_data + missing_keys = self.names.keys - self.result.keys rescue [] + missing_keys.each{|k| self.result[k] = "" } + end +end \ No newline at end of file diff --git a/app/models/hnc_head_images_uploader.rb b/app/models/hnc_head_images_uploader.rb new file mode 100644 index 0000000..a5eeecb --- /dev/null +++ b/app/models/hnc_head_images_uploader.rb @@ -0,0 +1,28 @@ +# encoding: utf-8 + +class HncHeadImagesUploader < CarrierWave::Uploader::Base + + # Include RMagick or ImageScience support: + # include CarrierWave::RMagick + # include CarrierWave::ImageScience + + # Choose what kind of storage to use for this uploader: + # storage :file + # storage :s3 + + # Override the directory where uploaded files will be stored. + # This is a sensible default for uploaders that are meant to be mounted: + def store_dir + return "uploads/#{model.class.to_s.underscore}/predict_tool" + end + + # override + def filename + @original_filename + end + + def cache_dir + "#{Rails.root}/tmp/uploads" + end + +end diff --git a/app/models/hnc_headimages.rb b/app/models/hnc_headimages.rb new file mode 100644 index 0000000..40dbdad --- /dev/null +++ b/app/models/hnc_headimages.rb @@ -0,0 +1,13 @@ +class HncHeadimages + include Mongoid::Document + include Mongoid::Timestamps + include OrbitModel::Status + include OrbitModel::Impression + # encoding: utf-8 + include OrbitTag::Taggable + include OrbitCategory::Categorizable + mount_uploader :temp_file, HncHeadImagesUploader + field :hnc_cancer_predictfields_id ,type:String ,default:"" + field :title ,type:String ,default:"" + field :sort_number ,type:Integer ,default: 0 +end \ No newline at end of file diff --git a/app/views/.keep b/app/views/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/admin/hnc_cancer_predicts/_export_cancer_tool_record.xlsx.axlsx b/app/views/admin/hnc_cancer_predicts/_export_cancer_tool_record.xlsx.axlsx new file mode 100644 index 0000000..5b87313 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/_export_cancer_tool_record.xlsx.axlsx @@ -0,0 +1,38 @@ +# encoding: utf-8 + +wb = xlsx_package.workbook +wb.add_worksheet(name: "cancer_tool") do |sheet| + if !results[0].nil? + row = [] + title = sheet.styles.add_style(:bg_color => "FFFF00",:border=>{ :style => :thin, :color => "666666" },:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true}) + column = sheet.styles.add_style(:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true},:border=>{ :style => :thin, :color => "666666" }) + row << ((I18n.locale=="en") ? 'submit time' : '提交時間') + @fields = results.first.names.keys + @fields.each do |field_name| + row << results.first.names[field_name][I18n.locale.to_s].split('
')[0] + end + #export data start + export_data_rows = [] + results.each do |result| + temp_row = [] + temp_row << result.created_at.to_s + result.result.each do |key,value| + if key != "locale" + if (result.values[key][I18n.locale.to_s].length == 0 rescue true) + temp_row << value + else + v = result.values[key][I18n.locale.to_s][value.to_i-1] rescue nil + temp_row << (v.nil? ? value : v) + end + end + end + export_data_rows << temp_row + end + + #export data end + sheet.add_row row , :style=> title,:widths => row.map{|cell| (cell.length* 11/ 2).round} + export_data_rows.each do |infos_row| + sheet.add_row infos_row , :style=> column + end + end +end \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/_form.html.erb b/app/views/admin/hnc_cancer_predicts/_form.html.erb new file mode 100644 index 0000000..e9bce99 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/_form.html.erb @@ -0,0 +1,38 @@ +
+ + + <% keys.each do |key| %> + + <%end%> + + \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/_form_file.html.erb b/app/views/admin/hnc_cancer_predicts/_form_file.html.erb new file mode 100644 index 0000000..4b76f25 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/_form_file.html.erb @@ -0,0 +1,33 @@ +<% if form_file.nil? %> +
+<% else %> +
+ <% if form_file.temp_file.blank? %> + <%= t(:no_file) %> + <% else %> + <%= link_to content_tag(:i) + form_file.file_identifier, form_file.temp_file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %> + <% end %> +<% end %> +<%= f.fields_for key do |f|%> +
+ + + <% if !form_file.nil? %> + + <%= f.hidden_field :id,:value=>(form_file.id) %> + + <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> + + <% end %> +
+
+<% end %> \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/_form_link.html.erb b/app/views/admin/hnc_cancer_predicts/_form_link.html.erb new file mode 100644 index 0000000..461a3fc --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/_form_link.html.erb @@ -0,0 +1,26 @@ +
+ + <%= f.text_field :url, class: "input-large", placeholder: t(:url) %> + + + <% @site_in_use_locales.each_with_index do |locale, i| %> + <%= locale %>"> + <%= f.fields_for :title_translations do |f| %> + <%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %> + <% end %> + + <% end %> + + + <% if form_link.new_record? %> + + + + <% else %> + + <%= f.hidden_field :id %> + + <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> + + <% end %> +
diff --git a/app/views/admin/hnc_cancer_predicts/_image_form.html.erb b/app/views/admin/hnc_cancer_predicts/_image_form.html.erb new file mode 100644 index 0000000..3354927 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/_image_form.html.erb @@ -0,0 +1,30 @@ +
+
+ +
+ <%= t('hnc_cancer_predict.sort_num')+': ' %> + <%= f.text_field 'sort_number',{:class=>'sort_num',:value=>((image_form['sort_number'] == nil) ? i+1 : image_form['sort_number'] ),:style=>'float: left;width: 3em;'} %> + <%= t('hnc_cancer_predict.logo')+': ' %> +
+ <% if image_form.temp_file.file.present? %> + <%= image_tag( image_form.temp_file, :size=>"120x120") rescue ''%> + <% else %> + <%= image_tag "/assets/site-logo.png", :class => "pull-left upload-picture"%> + <% end %> +
+
+ <% if image_form.temp_file.file.present?%> + + <%= f.file_field :temp_file, {:id => "input-upload", :class => 'fileupload-new', :accept=> 'image/png,image/gif,image/jpeg'} %><%= t('preferences.change') %> + + <%= f.check_box :remove_image,{:checked=>false} %> + <%= t(:remove) %> <%= (I18n.locale.to_s == 'en') ? ' this logo' : '該logo' %> + <%else%> + + <%= f.file_field :temp_file,{ :id => "input-upload", :class => 'fileupload-new', :accept=> 'image/png,image/gif,image/jpeg'} %><%= t('preferences.select_image') %> + + <%end%> + <%= t(:cancel) %> +
+
+
\ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/_index.html.erb b/app/views/admin/hnc_cancer_predicts/_index.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/admin/hnc_cancer_predicts/edit.html.erb b/app/views/admin/hnc_cancer_predicts/edit.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/admin/hnc_cancer_predicts/index.html.erb b/app/views/admin/hnc_cancer_predicts/index.html.erb new file mode 100644 index 0000000..73fcd65 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/index.html.erb @@ -0,0 +1,489 @@ +<%= stylesheet_link_tag "lib/fileupload"%> +<%= stylesheet_link_tag "lib/togglebox"%> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%#= javascript_include_tag "lib/bootstrap-datetimepicker" %> + <%#= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> + <%= javascript_include_tag "lib/file-type" %> + <%= javascript_include_tag "lib/module-area" %> + <%= javascript_include_tag "form" %> +<% end %> + + + +
+<%=form_for @form_to_show ,:url=>{:controller=>"hnc_cancer_predicts" ,:action=>"edit"} do |form|%> + <%= t('hnc_cancer_predict.title') %> +
+ + <%=form.fields_for :title_texts do |locale_fields|%> + <%=locale_fields.text_field I18n.locale.to_s ,{:value => @form_to_show.title_texts[I18n.locale.to_s],:id=>"title_text"} %> + <% end %> + <% if @title_images.length != 0%> + <% @title_images.each_with_index do |temp_image,i| %> + <%= form.fields_for "title_images" do |image_fields| %> +
+ <%= image_fields.fields_for i.to_s do |image_field| %> + <%= render :partial => 'image_form', :object => temp_image, :locals => {:f => image_field, :i => i} %> + <% if i.to_i == @title_images.length - 1%> + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <%= form.fields_for "title_images" do |image_fields| %> + <%= image_fields.fields_for "0" do |image_field| %> + + <% end %> + <% end %> + <% end %> +
+

+ <%= hidden_field_tag 'title_images_count', @title_images.count %> + <%= t('hnc_cancer_predict.add_image') %> +

+ <%= t('hnc_cancer_predict.tool_head_pictures') %> +
+ <% if @hnc_head_images.length != 0%> + <% @hnc_head_images.each_with_index do |temp_image,i| %> + <%= form.fields_for "hnc_head_images" do |image_fields| %> +
+ <%= image_fields.fields_for i.to_s do |image_field| %> + <%= render :partial => 'image_form', :object => temp_image, :locals => {:f => image_field, :i => i} %> + <% if i.to_i == @hnc_head_images.length - 1%> + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <%= form.fields_for "hnc_head_images" do |image_fields| %> + <%= image_fields.fields_for "0" do |image_field| %> + + <% end %> + <% end %> + <% end %> +
+

+ <%= hidden_field_tag 'hnc_head_images_count', @hnc_head_images.count %> + <%= t('hnc_cancer_predict.add_image') %> +

+ <%= t('hnc_cancer_predict.text_descibe') %> +
+ + <%= t('hnc_cancer_predict.font_size') %> +
+ <% @size=['small','medium','large'] %> + <% @size.each do |size|%> + <%= form.fields_for size do |make_size| %> +
<%= make_size.text_field 'font_size',{:value=> @form_to_show[size]['font_size'],:id=>'font_'+size} %> + <% if @form_to_show[size]['active'].to_i == 1%> + <%= make_size.check_box 'active',{:checked=>true,:class=>"checkbox text_choice",:style=>"float:left;"}%>
+ <% else%> + <%= make_size.check_box 'active',{:checked=>false,:class=>"checkbox text_choice",:style=>"float:left;"}%>
+ <%end%> + <%end%> + <%end%> + <%= t('hnc_cancer_predict.module_mode') %> +
+
+ +
+ +
+
+
+ <%= t('hnc_cancer_predict.Input_fields') %> +
+
' + head + '
' + ((index == 0) ? (((i==0)? '' : '+') + choice) : '-') + '
+ <% if key.include? "_file" %> + <%= render :partial => 'form_file', :object => (HncCancerPredictMappingFile.where(:id=> property[key]).first rescue nil), :locals => {:f => make_fields, :key=>key} %> + <% else %> + <% value = property[key] %> + <% value_type = HncCancerPredictfields::FIELDINFO[key] %> + <% value = "[]" if property == {} && value_type == 'Array' %> + <% is_localized = HncCancerPredictfields::NonLoclaized.exclude?(key) %> + <% @value= value %> + <% if is_localized %> + <% @disp_value = @value[I18n.locale.to_s] rescue "" %> + <%else%> + <% @disp_value = @value %> + <%end%> + <% @disp_value = hnc_yaml_dump(@disp_value) if value_type == 'Array' %> + <% field_type = ((value_type == 'String' || value_type == 'Array' || value_type == 'Float') ? "text_field" : value_type) %> + <% if value_type == 'Fixnum' %> + <% if @value == 1%> + <%= make_fields.check_box key,{:checked=>true,:class=>"checkbox",:style=>"float:left;"}%> + <% else%> + <%= make_fields.check_box key,{:checked=>false,:class=>"checkbox",:style=>"float:left;"}%> + <%end%> + <% elsif is_localized %> + <%=make_fields.fields_for I18n.locale.to_s do |locale_fields|%> + <%= locale_fields.send(field_type, key,{:value=>@disp_value}) %> + <%end%> + <% else %> + <%= make_fields.send(field_type, key,{:value=>@disp_value})%> + <%end%> + <%end%> + <%= make_fields.hidden_field :old_num,:value=>num.to_s %>
+ <% keys = HncCancerPredictfields::FIELDINFO.keys - HncCancerPredictfields::TherapyOnly %> + + + + + <% keys.each do |key|%> + + <%end%> + + + + <%= form.fields_for :form_show do |formfield|%> + <% @form_to_show.form_show.each do |num,property| %> + <%=formfield.fields_for num.to_s do |make_fields|%> + <%= render :partial => 'form', :locals=>{:make_fields=>make_fields,:property=>property,:num=>num,:keys => keys} %> + <%end%> + <%end%> + <%end%> + +
<%=t("hnc_cancer_predict.table.#{key}")%>
+ +
+ <%=t('hnc_cancer_predict.table.Results')%> +
+ + <% if @form_to_show.form_result_is_right.to_i == 1%> +
<%= form.check_box "form_result_is_right",{:checked=>true,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%>
+ <% else%> +
<%= form.check_box "form_result_is_right",{:checked=>false,:class=>"checkbox",:style=>"float: left;position: relative;left: 0;transform: none!important;margin-left: 1em;",:id=>"form_result_is_right"}%>
+ <%end%> +
+ <% @create_items = ['years','table_above_texts','text_above_texts','surgery_only_texts','extra_texts','extra_therapy_texts','danger_texts','texts_between_Result_and_result_block'] + array_indices = [0] + %> + <% @create_items.each_with_index do |item, i|%> + + <% if @form_to_show[item].class == BSON::Document || @form_to_show[item].class == Hash %> + <%= form.fields_for item do |locale_fields|%> + <% value = @form_to_show[item][I18n.locale.to_s] + if array_indices.include?(i) + value = hnc_yaml_dump(value) + end + %> + <%= locale_fields.text_field I18n.locale.to_s,{:value=> value,:id=> item,:style=>'width:calc(100% - 16em)'} %> + <% end %> + <% else %> + <% value = @form_to_show[item] + if array_indices.include?(i) + value = hnc_yaml_dump(value) + end + %> + <%= form.text_field item,{:value=> value,:id=> item,:style=>'width:calc(100% - 16em)'} %> + <% end %> +
+ <% end %> + + + + + + <% keys = HncCancerPredictfields::TherapyFields %> + <% keys.each do |key,vlaue|%> + + <%end%> + + + + <%= form.fields_for :form_show_in_result do |formfield|%> + <% @form_to_show.form_show_in_result.each do |num,property| %> + <%=formfield.fields_for num.to_s do |make_fields|%> + <%= render :partial => 'form', :locals=>{:make_fields=>make_fields,:property=>property,:num=>num,:keys => HncCancerPredictfields::TherapyFields} %> + <%end%> + <%end%> + <%end%> + +
<%=t("hnc_cancer_predict.table.#{key}")%>
+ +
+ <%=t('hnc_cancer_predict.table.calculate_settings')%> +
+
+
+ +
+
+ <%= form.text_area :hidden_variables, :rows=>"5", :style=> 'width: 100%;font-family: sans-serif;' %> +
+
+
+
+
+ +
+
+ <%= form.text_area :prediction_formula, :rows=>"5", :style=> 'width: 100%;font-family: sans-serif;' %> +
+
+
+ <% years = @form_to_show.years %> + <% years.each_with_index do |year,i| %> +
+
+ +
+
+ +
+
+ <% end %> +
+ <%=form.submit "#{t(:updatefont)}",{:id=>"updatebtn"}%> +<%end%> + + \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/new.html.erb b/app/views/admin/hnc_cancer_predicts/new.html.erb new file mode 100644 index 0000000..9ecaab7 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/new.html.erb @@ -0,0 +1,5 @@ +<%= form_for @bulletin, url: admin_announcements_path, html: {class: "form-horizontal main-forms previewable"} do |f| %> +
+ <%= render :partial => 'form', locals: {f: f} %> +
+<% end %> \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/settings.html.erb b/app/views/admin/hnc_cancer_predicts/settings.html.erb new file mode 100644 index 0000000..43db706 --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/settings.html.erb @@ -0,0 +1,150 @@ + +<% + sub_managers = @module_app.sub_managers + sub_managers.delete(nil) +%> +
<%= t("announcement.click_on_submit") %>
+<%= form_for @setting, url: (@setting.new_record? ? admin_announcement_createsettings_path : admin_announcement_updatesettings_path), html: {class: "form-horizontal main-forms"} do |f| %> +
+
+ <%= f.label :top_limit, t("announcement.top_limit"), :class => "control-label muted" %> +
+ <%= f.number_field :top_limit, :min => "0" %> + <%= t("announcement.for_unlimited") %> +
+
+ <% if AnnouncementSetting.is_pro? %> + <% if !sub_managers.blank? %> +
+ <%= f.label "Approver Setting", :class => "control-label muted" %> +
+ <%= t("announcement.approvers_list") %> + <%= @setting.approvers.count %> +
+
+ <% else %> + + <% end %> +
+ <%= f.label "Send emails to", :class => "control-label muted" %> +
+ > <%= t("admin") %> + > <%= t("manager") %> + > <%= t("announcement.approver") %> +
+
+
+
+ <% sub_managers.each do |sm| %> + <% if @setting.approvers.include?(sm.id.to_s) %> + + <% end %> + <% end %> +
+<% end %> +
+ <%= f.submit t('submit'), class: 'btn btn-primary' %> +
+<% end %> +<% if AnnouncementSetting.is_pro? %> + + +<% end %> + + + + + + + + diff --git a/app/views/admin/hnc_cancer_predicts/showSubmit.html.erb b/app/views/admin/hnc_cancer_predicts/showSubmit.html.erb new file mode 100644 index 0000000..623b62a --- /dev/null +++ b/app/views/admin/hnc_cancer_predicts/showSubmit.html.erb @@ -0,0 +1,87 @@ + + +<% if !@results[0].nil? %> + + + + + <% @results[0].names.each do |key,name|%> + + <%end%> + + + +<% @key_len = @results[0].names.length %> +<% @results.each do |result| %> + <% if result.names.length != @key_len %> + +
<%=((I18n.locale=="en") ? 'submit time' : '提交時間') %><%=name[I18n.locale.to_s].to_s.html_safe %>
+ + + + + <% result.names.each do |key,name|%> + + <%end%> + + + + <% end %> + + + <% result.result.each do |key,value| %> + <% @key_len %> + <% if key != "locale" %> + <% if (result.values[key][I18n.locale.to_s].length == 0 rescue true) %> + + <% else %> + + <% end %> + <% end %> + <%end%> + +<%end%> + +
<%=((I18n.locale=="en") ? 'submit time' : '提交時間') %><%=name[I18n.locale.to_s].to_s.html_safe %>
<%= result.created_at %><%= value.to_s %><% v = result.values[key][I18n.locale.to_s][value.to_i-1] rescue nil %><%= v.nil? ? value : v %>
+<% end %> +<%=@pagination.html_safe%> + \ No newline at end of file diff --git a/app/views/admin/hnc_cancer_predicts/update.html.erb b/app/views/admin/hnc_cancer_predicts/update.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/hnc_cancer_predicts/index.html.erb b/app/views/hnc_cancer_predicts/index.html.erb new file mode 100644 index 0000000..648b75c --- /dev/null +++ b/app/views/hnc_cancer_predicts/index.html.erb @@ -0,0 +1 @@ +<%= render_view %> \ No newline at end of file diff --git a/bin/rails b/bin/rails new file mode 100644 index 0000000..3f06d65 --- /dev/null +++ b/bin/rails @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/hnc_cancer_predict/engine', __FILE__) + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) + +# require 'rails/all' +# require 'rails/engine/commands' +require "action_controller/railtie" +require "action_mailer/railtie" +require "sprockets/railtie" +require "rails/test_unit/railtie" +require 'rails/engine/commands' +require "mongoid/railtie" diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..73169e2 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,69 @@ +en: + module_name: + hnc_cancer_predict: Predict Head and Neck Cancer Tool + hnc_cancer_predict: + hidden_variables: "Hidden Variables" + advance_mode_hint1: "After opening advance mode,calculation will change!\nAre you sure switch to advance mode?" + advance_mode_hint2: "一般模式: 選項設定在計算時對應到的值由1開始。(例如: 選項設定為[\"是\",\"否\"],則\"是\"在計算時對應到1,而\"否\"在計算時對應到2)。

進階模式: 選項設定在計算時對應到的值由0開始。
而若開啟選項值從大到小,則0對應到選項設定中的最後一項。
選項對應到的值的意思為當前述的計算值為0時,則對應到定義的Array的第1個元素的值,以此類推。
欄位對應檔案可上傳一個csv檔案,在計算時,會先依照csv中的第1直行,找到對應的變數1(生成的變數名稱為csv中的第1列)的值,其餘生成的變數值則為對應之後的同一橫列的值。" + module_mode: Module Mode + advance_mode: Advance Mode + Overall_Survival: Overall Survival + hnc_cancer_predict: Adjust the predict HNC tool + submitResult: see submit results of the users + result_is_right: Is therapy choices in the right hand side of result block? + text_descibe: text descibe + font_size: font size + small: small + medium: medium + large: large + Input_fields: User input fields' contents + tool_head_pictures: All the logos in the page of predict tool + sort_num: sort num + logo: logo image + title: title of the page of predict tool + title_text: title texts + add_image: add image + years: Years + table_above_texts: Texts above table + text_above_texts: Texts above text + surgery_only_texts: Surgery only texts + extra_texts: Extra texts + extra_therapy_texts: Extra therapy texts + danger_texts: Warning texts + texts_between_Result_and_result_block: Texts between "Result" and "Result block" + prev_page: Previous page + next_page: Next page + export_hnc_cancer_predict_tool_records: Export HNC predict tool records + table: + welcome: Welcome to The after head and neck cancer healing system of Taiwanprepare!\nTo start, please enter the relevant information below. + Reset: Reset + Submit: Submit + age: Age at diagnosis + Menopausal: Post Menopausal? + ER: ER status + HER2: HER2 status + PR: PR status + Tumoursize: Tumour size(mm) + Tumourgrade: Tumour grade + lymphnodes: lymph nodes + positive: positive + negative: negative + yes: yes + no: no + unknown: unknown + Results: Results + Treatment: Treatment + Additional_Benefit: Additional Benefit + Overall_Survival: Overall Survival(%) + Surgeryonly: Surgery only + Hormonetherapy: Hormone therapy + Chemotherapy: Chemotherapy + years: years + result: Results + table: Table + curve: Curves + text: Texts + Therapy_choice: Treatment options + lpv_impact: "lpv Impact(Input: Float)" + active_choice: "Active choice(input 1 present choice 1 is regarded as therapy enable)" + disable_condition: "Disable Condition" \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 0000000..60101c7 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,85 @@ +zh_tw: + module_name: + hnc_cancer_predict: 頭頸癌預測工具 + hnc_cancer_predict: + hidden_variables: "隱藏的變數" + advance_mode_hint1: "開啟進階模式後,計算方式有差異。\n您確定要開啟進階模式?" + advance_mode_hint2: "一般模式: 選項設定在計算時對應到的值由1開始。(例如: 選項設定為[\"是\",\"否\"],則\"是\"在計算時對應到1,而\"否\"在計算時對應到2)。

進階模式: 選項設定在計算時對應到的值由0開始。
而若開啟選項值從大到小,則0對應到選項設定中的最後一項。
選項對應到的值的意思為當前述的計算值為0時,則對應到定義的Array的第1個元素的值,以此類推。
欄位對應檔案可上傳一個csv檔案,在計算時,會先依照csv中的第1直行,找到對應的變數1(生成的變數名稱為csv中的第1列)的值,其餘生成的變數值則為對應之後的同一橫列的值。" + module_mode: 模組模式 + advance_mode: 進階模式 + Overall_Survival: 總生存率 + hnc_cancer_predict: 頭頸癌預測工具調整 + submitResult: 查看用戶繳交表單結果 + result_is_right: 治療選項在結果的右邊? + text_descibe: 文字說明 + font_size: 字體 + small: 小 + medium: 中 + large: 大 + Input_fields: 使用者輸入欄位內容 + tool_head_pictures: 預測工具頁面最上方的所有logo + sort_num: 順序號碼 + logo: logo圖片 + title: 預測工具頁面標題 + title_text: 標題文字 + add_image: 新增圖片 + years: 年 + table_above_texts: 在表格上方的文字 + text_above_texts: 在文字區塊上方的文字 + surgery_only_texts: 純手術的文字 + extra_texts: 額外文字 + extra_therapy_texts: 額外治療的文字 + danger_texts: 警告文字 + texts_between_Result_and_result_block: 在"結果"和"結果區塊"之間的文字 + prev_page: 上一頁 + next_page: 下一頁 + export_hnc_cancer_predict_tool_records: 匯出頭頸癌預測系統的使用者紀錄 + table: + welcome: 歡迎使用台灣準備頭頸癌癒後系統!\n若要開始 請在下方輸入相關資訊 + Reset: 重置 + Submit: 送出 + age: 確認年齡 + Menopausal: 更年期狀態 + ER: ER狀態 + HER2: HER2狀態 + PR: PR狀態 + Tumoursize: 腫瘤大小(mm) + Tumourgrade: 腫瘤分級 + lymphnodes: 淋巴結數目 + positive: 陽性 + negative: 陰性 + yes: 是 + no: 否 + unknown: 未知 + Results: 結果 + Treatment: 治療 + Additional_Benefit: 額外治療效益 + Overall_Survival: 總生存率(%) + Surgeryonly: 純手術 + Hormonetherapy: 賀爾蒙治療 + Chemotherapy: 化學治療 + years: 年 + result: 結果 + table: 列表 + curve: 曲線 + text: 文字 + Therapy_choice: 治療選項 + variable: 變數名稱 + name: 名稱 + is_num: 數字欄位 + hint: 提示文字 + comment_text: 說明文字 + choice_fields: '選項設定([]代表無選項)' + range: '數字範圍設定([]代表無範圍限制)' + right: 顯示在右側 + is_float: 可輸入小數 + revert_value: 選項值從大到小(ex:有兩個選項,則選項值依序為1和0) + map_values: 選項對應到的值(若無,則會使用初始值) + hnc_cancer_predict_mapping_file: 欄位對應檔案 + calculate_settings: 計算設定 + prediction_formula: 預測公式 + add_field: 新增填寫欄位 + add_therapy: 新增治療選項 + lpv_impact: "lpv 影響(輸入浮點數)" + active_choice: "啟用治療選項(輸入1代表第1個選項視為啟用治療)" + disable_condition: "禁用條件" \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..570c977 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,27 @@ +Rails.application.routes.draw do + if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console') + Thread.new do + c = HncCancerPredictfields.last + if c + sleep(5) + c.save + c.auto_write_predict_js + end + end + end + locales = Site.first.in_use_locales rescue I18n.available_locales + + scope "(:locale)", locale: Regexp.new(locales.join("|")) do + namespace :admin do + get 'hnc_cancer_predicts' , to: 'hnc_cancer_predicts#index' + get 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' + post 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' + patch 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' + get 'hnc_cancer_predicts/showSubmit' , to: 'hnc_cancer_predicts#showSubmit' + get 'hnc_cancer_predicts/export_cancer_tool_record' , to: 'hnc_cancer_predicts#export_cancer_tool_record' + resources :hnc_cancer_predicts + end + get "hnc_cancer_predictResult", to: "hnc_cancer_predicts#calculate" + post "hnc_cancer_predictResult", to: "hnc_cancer_predicts#calculate" + end +end diff --git a/hnc_cancer_predict.gemspec b/hnc_cancer_predict.gemspec new file mode 100644 index 0000000..9004fec --- /dev/null +++ b/hnc_cancer_predict.gemspec @@ -0,0 +1,56 @@ +# -*- encoding: utf-8 -*- +# stub: hnc_cancer_predict 0.0.1 ruby lib +bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install' +if bundle_update_flag + insert_flag = 0 + app_path = File.expand_path(__dir__) + template_path = ENV['PWD'] + '/app/templates' + all_template = Dir.glob(template_path+'/*/') + puts 'copying module' + check_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"%>' + edit_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"%>' + all_template.each do |folder| + if !folder.include?('mobile') + begin + if folder.split('/')[-1] != 'mobile' + begin + system ('cp -r '+ app_path + '/modules/. ' + folder+'/modules/.') + puts "finish copy module hnc_cancer_predict to #{folder}" + rescue + puts 'error copy' + end + end + texts = File.read(folder+'partial/_head.html.erb') + insert_flag = 0 + if texts.include?(check_texts) + texts = texts.gsub(check_texts,edit_texts) + insert_flag = 1 + end + if insert_flag == 1 + puts 'editing _head.html.erb' + f = File.open(folder+'partial/_head.html.erb','w') + f.write(texts) + f.close + end + rescue + puts "not found _head.html.erb in #{folder}" + end + end + end +end +Gem::Specification.new do |s| + s.name = "hnc_cancer_predict" + s.version = "0.0.1" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib"] + s.authors = ["Pohung Chiu"] + s.date = "2024-08-22" + s.description = "Predict Head and Neck Cancer Tool for Orbit" + s.email = ["bohung@rulingcom.com"] + s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] + s.homepage = "http://www.rulingcom.com" + s.licenses = ["MIT"] + s.summary = "Predict Head and Neck Cancer Tool for Orbit" + s.test_files = Dir["test/**/*"] +end diff --git a/lib/hnc_cancer_predict.rb b/lib/hnc_cancer_predict.rb new file mode 100644 index 0000000..9af00f7 --- /dev/null +++ b/lib/hnc_cancer_predict.rb @@ -0,0 +1,4 @@ +require "hnc_cancer_predict/engine" + +module HncCancerPredict +end diff --git a/lib/hnc_cancer_predict/engine.rb b/lib/hnc_cancer_predict/engine.rb new file mode 100644 index 0000000..bf6eded --- /dev/null +++ b/lib/hnc_cancer_predict/engine.rb @@ -0,0 +1,39 @@ +require "yaml" +module HncCancerPredict + class Engine < ::Rails::Engine + initializer "hnc_cancer_predict" do + OrbitApp.registration "HncCancerPredict", :type => "ModuleApp" do + base_url File.expand_path File.dirname(__FILE__) + taggable "hnc_cancer_predictfields" + categorizable + authorizable + widget_methods ["widget"] + widget_settings [{"data_count"=>1}] + set_keyword_contstraints ['hnc_cancer_predictResult'] + frontend_enabled + side_bar do + head_label_i18n 'hnc_cancer_predict.hnc_cancer_predict', icon_class: "icons-megaphone" + available_for "users" + active_for_controllers (['admin/hnc_cancer_predicts']) + head_link_path "admin_hnc_cancer_predicts_path" + + context_link 'hnc_cancer_predict.hnc_cancer_predict', + :link_path=>"admin_hnc_cancer_predicts_path" , + :priority=>1, + :active_for_action=>{'admin/hnc_cancer_predicts'=>'index'}, + :available_for => 'users' + context_link 'hnc_cancer_predict.submitResult', + :link_path=>"admin_hnc_cancer_predicts_showSubmit_path" , + :priority=>1, + :active_for_action=>{'admin/hnc_cancer_predicts'=>'show_submit'}, + :available_for => 'users' + context_link 'hnc_cancer_predict.export_hnc_cancer_predict_tool_records', + :link_path=>"admin_hnc_cancer_predicts_export_cancer_tool_record_path" , + :priority=>1, + :active_for_action=>{'admin/hnc_cancer_predicts'=>'export_cancer_tool_record'}, + :available_for => 'users' + end + end + end + end +end \ No newline at end of file diff --git a/lib/hnc_cancer_predict/version.rb b/lib/hnc_cancer_predict/version.rb new file mode 100644 index 0000000..c136718 --- /dev/null +++ b/lib/hnc_cancer_predict/version.rb @@ -0,0 +1,3 @@ +module HncCancerPredict + VERSION = "0.0.1" +end diff --git a/lib/tasks/hnc_cancer_predict_tasks.rake b/lib/tasks/hnc_cancer_predict_tasks.rake new file mode 100644 index 0000000..5db2f09 --- /dev/null +++ b/lib/tasks/hnc_cancer_predict_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :hnc_cancer_predict do +# # Task goes here +# end diff --git a/modules/hnc_cancer_predict/_hnc_cancer_predict_widget.html.erb b/modules/hnc_cancer_predict/_hnc_cancer_predict_widget.html.erb new file mode 100644 index 0000000..c3ecd8d --- /dev/null +++ b/modules/hnc_cancer_predict/_hnc_cancer_predict_widget.html.erb @@ -0,0 +1,7 @@ + + + +{{table}} +<%= stylesheet_link_tag "hnc_cancer_predict", media: "screen" %> +<%= stylesheet_link_tag "bootstrap.min.print", media: "print" %> +<%= stylesheet_link_tag "hnc_cancer_predict_print", media: "print" %> \ No newline at end of file diff --git a/modules/hnc_cancer_predict/hnc_cancer_predict_index.html.erb b/modules/hnc_cancer_predict/hnc_cancer_predict_index.html.erb new file mode 100644 index 0000000..c3ecd8d --- /dev/null +++ b/modules/hnc_cancer_predict/hnc_cancer_predict_index.html.erb @@ -0,0 +1,7 @@ + + + +{{table}} +<%= stylesheet_link_tag "hnc_cancer_predict", media: "screen" %> +<%= stylesheet_link_tag "bootstrap.min.print", media: "print" %> +<%= stylesheet_link_tag "hnc_cancer_predict_print", media: "print" %> \ No newline at end of file diff --git a/modules/hnc_cancer_predict/info.json b/modules/hnc_cancer_predict/info.json new file mode 100644 index 0000000..e281f23 --- /dev/null +++ b/modules/hnc_cancer_predict/info.json @@ -0,0 +1,22 @@ +{ + "frontend": [ + { + "filename" : "hnc_cancer_predict_index", + "name" : { + "zh_tw" : "1. 乳癌預測工具", + "en" : "1. Breast cancer predict tool" + }, + "thumbnail" : "thumb.png" + } + ], + "widgets" : [ + { + "filename" : "hnc_cancer_predict_widget", + "name" : { + "zh_tw" : "1. 乳癌預測工具", + "en" : "1. Breast cancer predict tool" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file diff --git a/modules/hnc_cancer_predict/thumbs/thumb.png b/modules/hnc_cancer_predict/thumbs/thumb.png new file mode 100644 index 0000000..266af56 Binary files /dev/null and b/modules/hnc_cancer_predict/thumbs/thumb.png differ diff --git a/reset_btn.txt b/reset_btn.txt new file mode 100644 index 0000000..670fccc --- /dev/null +++ b/reset_btn.txt @@ -0,0 +1 @@ +QG(function (a) { a = null != a && (a.v & 64 || h === a.J) ? P(Fi, a) : a; a = y.h(a, nu); console.log(a);return React.createElement("button", { onClick: a, className: "btn navbar-btn btn-danger btn-lg screen-only" }, " Reset ") }, new R(null, 1, 5, S, [ZG], null), "clear-all-button") \ No newline at end of file diff --git a/test/controllers/admin/hnc_cancer_predicts_controller_test.rb b/test/controllers/admin/hnc_cancer_predicts_controller_test.rb new file mode 100644 index 0000000..c7599b4 --- /dev/null +++ b/test/controllers/admin/hnc_cancer_predicts_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class Admin::HncCancerPredictsControllerTest < ActionController::TestCase + test "should get new" do + get :new + assert_response :success + end + + test "should get create" do + get :create + assert_response :success + end + +end diff --git a/test/dummy/README.rdoc b/test/dummy/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/test/dummy/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile new file mode 100644 index 0000000..ba6b733 --- /dev/null +++ b/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 0000000..5bc2e1c --- /dev/null +++ b/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require_tree . diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..a443db3 --- /dev/null +++ b/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..d83690e --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..593a778 --- /dev/null +++ b/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/test/dummy/bin/bundle b/test/dummy/bin/bundle new file mode 100644 index 0000000..66e9889 --- /dev/null +++ b/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails new file mode 100644 index 0000000..728cd85 --- /dev/null +++ b/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake new file mode 100644 index 0000000..1724048 --- /dev/null +++ b/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/test/dummy/config.ru b/test/dummy/config.ru new file mode 100644 index 0000000..5bc2a61 --- /dev/null +++ b/test/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb new file mode 100644 index 0000000..091c8f5 --- /dev/null +++ b/test/dummy/config/application.rb @@ -0,0 +1,29 @@ +require File.expand_path('../boot', __FILE__) + +# Pick the frameworks you want: +# require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +require "rails/test_unit/railtie" + +Bundler.require(*Rails.groups) +require "bulletin" + +module Dummy + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + end +end + diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb new file mode 100644 index 0000000..6266cfc --- /dev/null +++ b/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb new file mode 100644 index 0000000..a384d95 --- /dev/null +++ b/test/dummy/config/environments/development.rb @@ -0,0 +1,34 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb new file mode 100644 index 0000000..4f67ce3 --- /dev/null +++ b/test/dummy/config/environments/production.rb @@ -0,0 +1,80 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable Rails's static asset server (Apache or nginx will already do this). + config.serve_static_assets = false + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Generate digests for assets URLs. + config.assets.digest = true + + # Version of your assets, change this if you want to expire all your assets. + config.assets.version = '1.0' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Set to :debug to see everything in the log. + config.log_level = :info + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets. + # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. + # config.assets.precompile += %w( search.js ) + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new +end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..053f5b6 --- /dev/null +++ b/test/dummy/config/environments/test.rb @@ -0,0 +1,39 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static asset server for tests with Cache-Control for performance. + config.serve_static_assets = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/test/dummy/config/initializers/cookies_serializer.rb b/test/dummy/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7a06a89 --- /dev/null +++ b/test/dummy/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb new file mode 100644 index 0000000..72aca7e --- /dev/null +++ b/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf +# Mime::Type.register_alias "text/html", :iphone diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb new file mode 100644 index 0000000..e766b67 --- /dev/null +++ b/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..b81ea74 --- /dev/null +++ b/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,9 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/test/dummy/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb new file mode 100644 index 0000000..3f66539 --- /dev/null +++ b/test/dummy/config/routes.rb @@ -0,0 +1,56 @@ +Rails.application.routes.draw do + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/test/dummy/config/secrets.yml b/test/dummy/config/secrets.yml new file mode 100644 index 0000000..e9213c0 --- /dev/null +++ b/test/dummy/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 51f457918fc204bef2280de08080b24d6289997cc1af905e47aead42b5e027b6bc27cd6cbd1cb11a34d8df4163d63db2a0ff973acfa11b239a5dd15d6bfb5bfd + +test: + secret_key_base: 1a2d31f4fb35a33e52a69eac67e125b9b1ba5b302e8d3468e60282061a8e74d1a8d977fb88f2eb001aecb99c9c3fbde29e0c7c5ac5d548e1458772ee50ed48e9 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html new file mode 100644 index 0000000..a21f82b --- /dev/null +++ b/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html new file mode 100644 index 0000000..061abc5 --- /dev/null +++ b/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/test/helpers/admin/hnc_cancer_predicts_helper_test.rb b/test/helpers/admin/hnc_cancer_predicts_helper_test.rb new file mode 100644 index 0000000..10de434 --- /dev/null +++ b/test/helpers/admin/hnc_cancer_predicts_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class Admin::HncCancerPredictsHelperTest < ActionView::TestCase +end diff --git a/test/hnc_cancer_predict_test.rb b/test/hnc_cancer_predict_test.rb new file mode 100644 index 0000000..7e8f4e2 --- /dev/null +++ b/test/hnc_cancer_predict_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class HncCancerPredictTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, Bulletin + end +end diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb new file mode 100644 index 0000000..eec8c0e --- /dev/null +++ b/test/integration/navigation_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + + # test "the truth" do + # assert true + # end +end + diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..1e26a31 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../dummy/config/environment.rb", __FILE__) +require "rails/test_help" + +Rails.backtrace_cleaner.remove_silencers! + +# Load support files +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } + +# Load fixtures from the engine +if ActiveSupport::TestCase.method_defined?(:fixture_path=) + ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) +end