Compare commits

..

35 Commits

Author SHA1 Message Date
邱博亞 c298ea9d5b Fix bug in backend setting. 2024-08-22 22:41:58 +08:00
邱博亞 d5b44f5056 Fix bug. 2024-03-18 21:29:26 +08:00
邱博亞 8efe06a494 remove carrierwave/processing/mime_type for new version 2024-03-18 21:21:33 +08:00
BoHung Chiu ae1b7e8f59 Fix bug. 2022-06-17 21:26:16 +08:00
BoHung Chiu 4f5fa8ea7d Fix js not reload bug. 2022-06-17 20:14:33 +08:00
BoHung Chiu 2dd74d353b Fix bug. 2022-05-23 18:37:05 +08:00
BoHung Chiu 8b9f29bd06 Fix bug. 2022-05-23 18:21:10 +08:00
BoHung Chiu 51ccf775bd Fix js bug. 2022-02-25 10:55:57 +08:00
BoHung Chiu 3e2fa1d36b Fix js bug. 2022-02-25 10:50:18 +08:00
BoHung Chiu c262b1174d Fix bug. 2022-02-09 16:04:14 +08:00
BoHung Chiu 21fd4b2a49 Fix css. 2022-02-09 15:38:01 +08:00
BoHung Chiu 34166d2688 Fix bug. 2022-02-08 15:43:04 +08:00
BoHung Chiu 6e45b4415f Fix bug. 2022-02-07 19:24:16 +08:00
BoHung Chiu bf673a6d10 Fix bug. 2022-02-07 19:15:44 +08:00
BoHung Chiu ecac7f291d Fix bug. 2022-02-07 18:30:25 +08:00
BoHung Chiu 2f877d7005 Fix bug. 2022-02-07 17:29:35 +08:00
BoHung Chiu 877e4dbf2b Fix bug. 2022-01-28 15:51:45 +08:00
BoHung Chiu fcfee3894f Fix bug. 2022-01-28 15:50:09 +08:00
BoHung Chiu 0902666c24 Fix bug. 2022-01-28 15:41:38 +08:00
BoHung Chiu 0cac9b38ae Fix backend page bug. 2022-01-28 12:50:22 +08:00
BoHung Chiu 2afafdc7c0 Fix bug. 2022-01-27 17:05:02 +08:00
BoHung Chiu 7b32eaa059 Fix bug. 2022-01-26 19:56:40 +08:00
BoHung Chiu d60229b5c6 Fix bug. 2022-01-26 19:50:39 +08:00
BoHung Chiu 47a4d50536 Fix bug. 2022-01-26 19:41:02 +08:00
BoHung Chiu a2b2d1674a Fix bug. 2022-01-26 19:27:35 +08:00
BoHung Chiu 59241bab52 Fix bug. 2022-01-26 16:30:39 +08:00
BoHung Chiu 4b911f3a28 Merge from final_version.(Finish version 2.(lpv calculation is editable)) 2022-01-26 14:11:23 +08:00
BOHUNG ce2c172f6b fix bugs(choose float field will get no value) in version 1. 2020-03-04 12:04:55 +08:00
BOHUNG 05a2a18763 add module_name to fix translations missing. 2020-02-24 15:29:23 +08:00
BOHUNG 7441a96bc5 fix bug 2020-02-06 15:48:50 +08:00
BOHUNG d1f87a2370 add export record feature 2020-02-03 16:49:00 +08:00
BOHUNG d8255b6ad0 fix 2020-02-03 15:26:04 +08:00
BOHUNG 62045584fc push from final_version to master 2020-01-28 18:29:04 +08:00
BOHUNG 294d98f83f copy from final_version branch to master 2020-01-13 19:35:30 +08:00
BOHUNG 34b4187716 finish reset_btn and set a submit_btn 2019-11-22 17:43:39 +08:00
3 changed files with 13 additions and 15 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("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt", 'w')
@file_tmp = File.new('cancer_tool_table_tmp_'+locale.to_s+'.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("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt", 'w')
@file_tmp = File.new('cancer_tool_table_tmp_'+locale.to_s+'.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("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt")
@table_str = File.read('public/cancer_tool_table_tmp_'+I18n.locale.to_s+'.txt')
preidct_js_url = '/assets/cancer_predict.js'
if File.exist?(Cancerpredictfields::JSFileName)
js_filename = File.read(Cancerpredictfields::JSFileName)
if js_filename.include?('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$/)
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("#{Cancerpredictfields::ToolTablePrefix}#{I18n.locale}.txt")
@table_str = File.read('public/cancer_tool_table_tmp_'+I18n.locale.to_s+'.txt')
preidct_js_url = '/assets/cancer_predict.js'
if File.exist?(Cancerpredictfields::JSFileName)
js_filename = File.read(Cancerpredictfields::JSFileName)
if js_filename.include?('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$/)
asset = Rails.application.assets[js_filename]
preidct_js_url = "#{Rails.application.config.assets.prefix}/#{asset.digest_path}"
else

View File

@ -9,8 +9,6 @@ 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:{
@ -289,7 +287,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(JSFileName, 'w+'){|f| f.write(new_path)}
File.open("#{Rails.root}/public/cancer_tool_js_filename.txt",'w+'){|f| f.write(new_path)}
end
end
def generate_eval_formula
@ -484,8 +482,8 @@ class Cancerpredictfields
if need_write
File.write(save_path,file_texts)
reload_js_asset(save_path, force_reload)
elsif !(File.exist?(JSFileName))
File.open(JSFileName, 'w+'){|f| f.write(save_path)}
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)}
end
end
def get_years_settings_dict