Fix bug.
This commit is contained in:
parent
742adb814d
commit
5bf740d454
|
@ -185,12 +185,12 @@ class Cancerpredictfields
|
|||
@years = self.years
|
||||
@head_name = ['Treatment','Additional_Benefit','Overall_Survival']
|
||||
# @head_name = ['Treatment','Overall_Survival']
|
||||
@table_head = @head_name.map{|name| I18n.t('cancerpredict.table.'+name)}
|
||||
@therapy_names = self.treatment_method
|
||||
I18n.available_locales.each do |locale|
|
||||
I18n.with_locale(locale) do
|
||||
@table_head = @head_name.map{|name| I18n.t('cancerpredict.table.'+name)}
|
||||
@therapy_choices = [I18n.t('cancerpredict.table.Surgeryonly')]
|
||||
self.form_show_in_result.values.each{|choice| @therapy_choices.push choice["name"][locale]}
|
||||
self.form_show_in_result.values.each{|choice| @therapy_choices.push choice["name"][locale].to_s}
|
||||
tmp_table = "<span class=\"result_title print_only\">#{I18n.t("cancerpredict.table.table")}</span><div style=\"clear: both\"></div>"
|
||||
tmp_table += '<input id="current_year" type="hidden" value="'+@years[-1].to_s+'" index="0"/><p id="cancer_table_texts">'+self.table_above_texts[locale].to_s+'</p>'
|
||||
tmp_table += ('<a style="display: inline-block;">'+(locale.to_s == 'zh_tw' ? '第' : '')+'</a><a style="display: inline-block;">')
|
||||
|
@ -211,7 +211,7 @@ class Cancerpredictfields
|
|||
@texts = @texts.split('{{years}}')
|
||||
@texts.delete('')
|
||||
tmp_text = "<span class=\"result_title print_only\">#{I18n.t("cancerpredict.table.text")}</span><div style=\"clear: both\"></div>"
|
||||
tmp_text += ('<span>'+@texts[0])
|
||||
tmp_text += ('<span>'+@texts[0].to_s)
|
||||
@years.each{|year| tmp_text += ('<button class="cancer_years cancer_table_btn btn btn-default btn-sm" style="float:none;">'+year.to_s+'</button>')}
|
||||
if @texts.count > 1
|
||||
tmp_text += (@texts[1]+'</span>') if @texts.count > 1
|
||||
|
@ -228,7 +228,7 @@ class Cancerpredictfields
|
|||
@surgery_only_texts = ''
|
||||
end
|
||||
tmp_text += @surgery_only_texts
|
||||
tmp_text += '<span class="addition">'+self.extra_texts[locale]+'</span><div class="extra-text" style="display:none;"><div class="texts_show" style="clear:both;"></div></div></p>'
|
||||
tmp_text += '<span class="addition">'+(self.extra_texts[locale].to_s rescue '')+'</span><div class="extra-text" style="display:none;"><div class="texts_show" style="clear:both;"></div></div></p>'
|
||||
tmp_text_translations[locale] = tmp_text
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue