Compare commits

..

73 Commits

Author SHA1 Message Date
邱博亞 d2b3464359 Refine constant variables. 2024-08-23 21:04:57 +08:00
邱博亞 64626817e9 Fix bug in backend setting. 2024-08-22 22:41:33 +08:00
邱博亞 2cb22f4f6f Fix bug. 2024-03-18 21:31:15 +08:00
邱博亞 e03e27dc17 remove carrierwave/processing/mime_type for new version 2024-03-18 21:22:36 +08:00
BoHung Chiu 93ef387b68 Fix js not reload bug. 2022-06-17 21:27:04 +08:00
BoHung Chiu f8264413f0 Fix bug. 2022-05-23 18:37:59 +08:00
BoHung Chiu 586f83142d Fix bug. 2022-05-23 18:21:24 +08:00
BoHung Chiu 5ffa34b151 Fix js bug. 2022-02-25 10:56:33 +08:00
BoHung Chiu dbbe675584 Fix js bug. 2022-02-25 10:48:47 +08:00
BoHung Chiu 2f7135e146 Fix bug. 2022-02-09 16:03:25 +08:00
BoHung Chiu 19daac4173 Fix css. 2022-02-09 15:37:00 +08:00
BoHung Chiu 5206181fed Fix bug. 2022-02-08 15:43:57 +08:00
BoHung Chiu 0ebff5a9e5 Fix bug. 2022-02-07 19:23:59 +08:00
BoHung Chiu 543b5cf42f Fix bug. 2022-02-07 19:16:57 +08:00
BoHung Chiu ca4a48cb51 Fix bug. 2022-02-07 18:30:10 +08:00
BoHung Chiu 40d4b889fd Fix bug. 2022-02-07 17:28:23 +08:00
BoHung Chiu 163805f8c1 Fix bug. 2022-01-28 15:52:07 +08:00
BoHung Chiu f897f12ef5 Fix bug. 2022-01-28 15:50:46 +08:00
BoHung Chiu e3c123e5aa Fix bug. 2022-01-28 15:40:23 +08:00
BoHung Chiu dd52046c16 Fix backend page bug. 2022-01-28 12:49:19 +08:00
BoHung Chiu 5bf740d454 Fix bug. 2022-01-27 17:04:13 +08:00
BoHung Chiu 742adb814d Fix bug. 2022-01-26 19:57:55 +08:00
BoHung Chiu 7724fd5769 Fix bug. 2022-01-26 19:49:52 +08:00
BoHung Chiu ca5c47d7f5 Fix bug. 2022-01-26 19:41:50 +08:00
BoHung Chiu 6a1cac01aa Fix bug. 2022-01-26 19:26:56 +08:00
BoHung Chiu 4b4c960d14 Fix bug. 2022-01-26 16:27:55 +08:00
BoHung Chiu 137e13ad1b Finish version 2.(lpv calculation is editable) 2022-01-26 14:05:57 +08:00
BOHUNG 9f3f337dec fix 2020-03-28 11:42:16 +08:00
BOHUNG 846024ac51 fix 2020-03-28 11:35:01 +08:00
BOHUNG f93a11d638 fix bugs(choose float field will get no value) in version 1. 2020-03-04 12:07:05 +08:00
BOHUNG 9428475124 add module_name to fix translations missing. 2020-02-24 15:31:28 +08:00
BOHUNG e116f69577 fix bug 2020-02-06 15:50:25 +08:00
BOHUNG db59135626 add export record feature 2020-02-03 16:47:49 +08:00
BOHUNG 817ecf0377 fix 2020-02-03 15:27:29 +08:00
BOHUNG 38e35fb560 fix problem in 2020/1/15 2020-01-28 18:24:52 +08:00
BOHUNG da1eed7786 fix 2020-01-13 19:19:11 +08:00
BOHUNG 19b2afcab1 fix 2020-01-13 19:16:41 +08:00
BOHUNG 65b96b9fdc fix 2020-01-13 19:15:43 +08:00
BOHUNG 25e3ae7fde add change bootstrap.js by code 2020-01-13 19:13:37 +08:00
BOHUNG 4620557e72 fix 2020-01-13 19:06:28 +08:00
BOHUNG cf9bec7a61 add auto copy index.erb to module 2020-01-13 19:04:02 +08:00
BOHUNG 893fe1e33b fix 2020-01-13 18:57:23 +08:00
BOHUNG 8f7a0ce704 add routed edit code 2020-01-13 18:54:51 +08:00
BOHUNG 52a197a68d fix some bug in js 2020-01-13 16:15:21 +08:00
BOHUNG 5962eed8a0 fix wrong layout in english 2020-01-13 15:38:21 +08:00
BOHUNG 9aba9a3f0b edit page css to fix the layout 2020-01-12 21:47:55 +08:00
BOHUNG 456ce12222 fix very much problems.
Let user change the texts in table and text tab.
Add the english contents.
fix print problem.
change contents before 2020/1/12
2020-01-12 13:14:58 +08:00
BOHUNG 4b8fed7e52 remove unused \ in the url 2019-12-28 18:54:28 +08:00
BOHUNG 77e92b7297 finish everything before 2019/12/26 2019-12-28 17:57:13 +08:00
BOHUNG 0101f3bef0 adjust some things about predict tools. 2019-12-27 13:49:20 +08:00
BOHUNG e2bc83ec2e finish edit content of tools before 2019/12/21(include the user choices) 2019-12-21 23:50:17 +08:00
BOHUNG 74fff06818 edit the calculate of the predict and edit css to make the logo in the right place and right size 2019-12-17 21:27:11 +08:00
BOHUNG 190752a275 finish the first version of predict tool.and finish the backend control panel of this tool. 2019-12-15 21:08:41 +08:00
BOHUNG 24d14e2b3b -0.5=>0.5,add image uploader 2019-12-14 12:21:09 +08:00
BOHUNG 788f495c29 After user submit,user can change input data,to see the result change. 2019-12-13 16:54:46 +08:00
chiu 7982622ca8 add the feature that will collect user input and user can edit the form in the admin page. 2019-12-11 23:59:17 +08:00
BOHUNG 1e41d84353 fix all problem 2019-12-10 19:33:28 +08:00
chiu f5af46731e fix bugs 2019-12-09 21:25:59 +08:00
BOHUNG 63bfb834ac vrsion 1 2019-12-09 09:47:53 +08:00
BOHUNG 98738db5d1 finish js 2019-12-09 00:43:40 +08:00
BOHUNG 8945e3b64a fix js bug 2019-12-09 00:38:40 +08:00
BOHUNG 32bd2ffac5 add calculate additional benefit and finish text result 2019-12-08 20:21:32 +08:00
BOHUNG 2e00a82db4 finish add overall_servival 2019-12-08 13:32:03 +08:00
BOHUNG 6b1d72e54a finish table and text except calculate 2019-12-07 21:01:52 +08:00
BOHUNG c1a2927e1e finish result choices and result_tab 2019-12-07 12:12:33 +08:00
BOHUNG d8d02fb590 finish the table and add the post of submit_btn and return the lpv result 2019-12-03 21:17:09 +08:00
BOHUNG 296e19929c add left and right block 2019-11-28 22:58:03 +08:00
BOHUNG 3353d1595b add create the cancer_predict_tool_table 2019-11-27 21:24:09 +08:00
BOHUNG be9c1f3d05 finish a half of predict_tool 2019-11-23 17:49:18 +08:00
BOHUNG 741d440631 add a lot of things 2019-11-23 16:14:56 +08:00
BOHUNG 88b5a9bbed add admin_index and set form_show 2019-11-23 11:15:11 +08:00
chiu d9be851646 Update cancerpredictfields.rb 2019-11-21 20:44:39 +08:00
chiu d4afee639d Update cancerpredictfields.rb 2019-11-21 20:36:20 +08:00
3 changed files with 15 additions and 13 deletions

View File

@ -330,7 +330,7 @@ class Admin::CancerpredictsController < OrbitAdminController
Dir.chdir("public") do
@site_locales = Site.last.in_use_locales.each do |locale|
I18n.with_locale(locale) do
@file_tmp = File.new('cancer_tool_table_tmp_'+locale.to_s+'.txt', 'w')
@file_tmp = File.new("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt", 'w')
tmp_table_texts = create_table(locale)
@file_tmp.write(tmp_table_texts)
@file_tmp.close
@ -654,7 +654,7 @@ class Admin::CancerpredictsController < OrbitAdminController
Dir.chdir("public") do
@site_locales = Site.last.in_use_locales.each do |locale|
I18n.with_locale(locale) do
@file_tmp = File.new('cancer_tool_table_tmp_'+locale.to_s+'.txt', 'w')
@file_tmp = File.new("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt", 'w')
tmp_table_texts = create_table(locale)
@file_tmp.write(tmp_table_texts)
@file_tmp.close

View File

@ -147,11 +147,11 @@ class CancerpredictsController < ApplicationController
uid = OrbitHelper.params[:uid] rescue ""
tags = OrbitHelper.widget_tags
categories = OrbitHelper.widget_categories || []
@table_str = File.read('public/cancer_tool_table_tmp_'+I18n.locale.to_s+'.txt')
@table_str = File.read("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt")
preidct_js_url = '/assets/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(/cancer_predict\.js$/)
if File.exist?(Cancerpredictfields::JSFileName)
js_filename = File.read(Cancerpredictfields::JSFileName)
if js_filename.include?('cancer_predict.js')
asset = Rails.application.assets[js_filename]
preidct_js_url = "#{Rails.application.config.assets.prefix}/#{asset.digest_path}"
else
@ -167,11 +167,11 @@ class CancerpredictsController < ApplicationController
uid = OrbitHelper.params[:uid] rescue ""
tags = OrbitHelper.widget_tags
categories = OrbitHelper.widget_categories || []
@table_str = File.read('public/cancer_tool_table_tmp_'+I18n.locale.to_s+'.txt')
@table_str = File.read("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt")
preidct_js_url = '/assets/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(/cancer_predict\.js$/)
if File.exist?(Cancerpredictfields::JSFileName)
js_filename = File.read(Cancerpredictfields::JSFileName)
if js_filename.include?('cancer_predict.js')
asset = Rails.application.assets[js_filename]
preidct_js_url = "#{Rails.application.config.assets.prefix}/#{asset.digest_path}"
else

View File

@ -9,6 +9,8 @@ class Cancerpredictfields
AdvanceFields = ["revert_value","map_values","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/cancer_tool_js_filename.txt".freeze
ToolTablePrefix = "public/cancer_tool_table_tmp_".freeze
field :title ,type:String ,default:""
field :advance_mode, type: Boolean, default: false
field :form_show , :type=> Hash ,default:{
@ -287,7 +289,7 @@ class Cancerpredictfields
end
def reload_js_asset(path, force_reload=false)
reload_any_asset(path, 'application/javascript', force_reload) do |new_path|
File.open("#{Rails.root}/public/cancer_tool_js_filename.txt",'w+'){|f| f.write(new_path)}
File.open(JSFileName, 'w+'){|f| f.write(new_path)}
end
end
def generate_eval_formula
@ -482,8 +484,8 @@ class Cancerpredictfields
if need_write
File.write(save_path,file_texts)
reload_js_asset(save_path, force_reload)
elsif !(File.exist?("#{Rails.root}/public/cancer_tool_js_filename.txt"))
File.open("#{Rails.root}/public/cancer_tool_js_filename.txt",'w+'){|f| f.write(save_path)}
elsif !(File.exist?(JSFileName))
File.open(JSFileName, 'w+'){|f| f.write(save_path)}
end
end
def get_years_settings_dict