Refine constant variables.
This commit is contained in:
parent
be5b892aee
commit
e994a0fac5
|
|
@ -333,7 +333,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(Cancerpredictfields::ToolTableMap[I18n.locale], "w")
|
||||
tmp_table_texts = create_table(locale)
|
||||
@file_tmp.write(tmp_table_texts)
|
||||
@file_tmp.close
|
||||
|
|
@ -661,7 +661,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(Cancerpredictfields::ToolTableMap[I18n.locale], "w")
|
||||
tmp_table_texts = create_table(locale)
|
||||
@file_tmp.write(tmp_table_texts)
|
||||
@file_tmp.close
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ 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(Cancerpredictfields::ToolTableMap[I18n.locale])
|
||||
preidct_js_url = "/assets/cancer_predict.js"
|
||||
if File.exist?(Cancerpredictfields::JSFileName)
|
||||
js_filename = File.read(Cancerpredictfields::JSFileName)
|
||||
|
|
@ -171,7 +171,7 @@ 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(Cancerpredictfields::ToolTableMap[I18n.locale])
|
||||
preidct_js_url = "/assets/cancer_predict.js"
|
||||
if File.exist?(Cancerpredictfields::JSFileName)
|
||||
js_filename = File.read(Cancerpredictfields::JSFileName)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ class Cancerpredictfields
|
|||
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
|
||||
ToolTableMap = I18n.available_locales.map do |locale|
|
||||
[locale, "public/cancer_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:{
|
||||
|
|
|
|||
Loading…
Reference in New Issue