Compare commits
35 Commits
d2b3464359
...
c298ea9d5b
Author | SHA1 | Date |
---|---|---|
|
c298ea9d5b | |
|
d5b44f5056 | |
|
8efe06a494 | |
|
ae1b7e8f59 | |
|
4f5fa8ea7d | |
|
2dd74d353b | |
|
8b9f29bd06 | |
|
51ccf775bd | |
|
3e2fa1d36b | |
|
c262b1174d | |
|
21fd4b2a49 | |
|
34166d2688 | |
|
6e45b4415f | |
|
bf673a6d10 | |
|
ecac7f291d | |
|
2f877d7005 | |
|
877e4dbf2b | |
|
fcfee3894f | |
|
0902666c24 | |
|
0cac9b38ae | |
|
2afafdc7c0 | |
|
7b32eaa059 | |
|
d60229b5c6 | |
|
47a4d50536 | |
|
a2b2d1674a | |
|
59241bab52 | |
|
4b911f3a28 | |
|
ce2c172f6b | |
|
05a2a18763 | |
|
7441a96bc5 | |
|
d1f87a2370 | |
|
d8255b6ad0 | |
|
62045584fc | |
|
294d98f83f | |
|
34b4187716 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue