From a4154b864760d170097c1b26f8e50a7a13320305 Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Fri, 15 Nov 2019 17:02:17 +0800 Subject: [PATCH] fix --- app/assets/javascripts/react.js | 2 +- .../admin/cancerpredicts_controller.rb | 2 +- app/controllers/cancerpredicts_controller.rb | 27 ++++++++++++++++++ app/views/cancerpredicts/index.html.erb | 1 + config/locales/en.yml | 2 +- config/locales/zh_tw.yml | 6 ++-- lib/cancerpredict/engine.rb | 3 +- .../_cancer_predict_widget.html.erb | 20 +++++++++++++ .../cancer_predict_index.html.erb | 16 +++++++++++ modules/cancerpredict/info.json | 22 ++++++++++++++ modules/cancerpredict/thumbs/thumb.png | Bin 0 -> 4075 bytes 11 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 app/controllers/cancerpredicts_controller.rb create mode 100644 app/views/cancerpredicts/index.html.erb create mode 100644 modules/cancerpredict/_cancer_predict_widget.html.erb create mode 100644 modules/cancerpredict/cancer_predict_index.html.erb create mode 100644 modules/cancerpredict/info.json create mode 100644 modules/cancerpredict/thumbs/thumb.png diff --git a/app/assets/javascripts/react.js b/app/assets/javascripts/react.js index dcee495..bce11ff 100644 --- a/app/assets/javascripts/react.js +++ b/app/assets/javascripts/react.js @@ -1328,7 +1328,7 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { null), new R(null, 2, 5, S, [XE, "Curves"], null), new R(null, 2, 5, S, [$v, "Chart"], null), new R(null, 2, 5, S, [Qp, "Texts"], null), new R(null, 2, 5, S, [ru, "Icons"], null)], null), null, Vr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), NB.c(wL(new m(null, 1, [NB, on], null)))), BL(eo, "Enable bisphosphonates", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [cF, "No"], null), new R(null, 2, 5, S, [Bm, "Yes"], null)], null), null, Vr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), eo.c(wL(new m(null, 1, [eo, Bm], null)))), BL(fF, "Enable 10 year hormone treatment?", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [cF, "No"], null), new R(null, 2, 5, S, [cF, "Not yet implemented"], null)], null), null, Vr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), fF.c(wL(new m(null, 1, [fF, cF], null)))), BL(VA, "Enable disease free survival", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [cF, "No"], null), new R(null, 2, 5, S, [cF, "Not yet implemented"], null)], null), null, Vr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), VA.c(wL(new m(null, 1, [VA, cF], null)))), BL(PF, "Hormone Therapy", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [null, "No"], null), new R(null, 2, 5, S, [Bm, "Yes"], null)], null), null, Ip, new Ri(null, new m(null, 2, ["v1.2", null, "v2.1", null], null), null), null), BL($m, "Bisphosphonates", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [null, "No"], null), new R(null, 2, 5, S, [Bm, "Yes"], null)], null), null, Ip, new Ri(null, new m(null, 1, ["v2.1", null], null), null), null), BL(up, "Trastuzumab", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [null, "No"], null), new R(null, 2, 5, S, [Bm, "Yes"], null)], null), null, Ip, new Ri(null, new m(null, 2, ["v1.2", null, "v2.1", null], - null), null), null), BL(BA, "Prior treatments", At, "Surgery is assumed", !1, Bp, new Ri(null, new m(null, 1, ["v2.1", null], null), null), null), BL(fn, "Age at diagnosis", mx, new m(null, 4, [Ll, 25, yx, 85, fD, 1, Qq, 0], null), !0, yr, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), ""), BL(Zk, "Post Menopausal?", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bz, "Yes"], null), new R(null, 2, 5, S, [Ln, "No"], null)], null), !0, yr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), null), BL(Br, "Detected by", + null), null), null), BL(BA, "Prior treatments", At, "Surgery is assumed", !1, Bp, new Ri(null, new m(null, 1, ["v2.1", null], null), null), null), BL(fn, <%=t(cancerpredict)%>, mx, new m(null, 4, [Ll, 25, yx, 85, fD, 1, Qq, 0], null), !0, yr, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), ""), BL(Zk, "Post Menopausal?", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bz, "Yes"], null), new R(null, 2, 5, S, [Ln, "No"], null)], null), !0, yr, new Ri(null, new m(null, 1, ["v2.1", null], null), null), null), BL(Br, "Detected by", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [ln, "Screening"], null), new R(null, 2, 5, S, [uB, "Symptoms"], null)], null), !0, Bp, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), null), BL(Qw, "Tumour grade", Wl, new R(null, 3, 5, S, [new R(null, 2, 5, S, [sp, 1], null), new R(null, 2, 5, S, [Ko, 2], null), new R(null, 2, 5, S, [Dx, 3], null)], null), !1, Bp, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), null), BL(vu, "Tumour size (mm)", mx, new m(null, 4, [Ll, 0, yx, 500, fD, 5, Qq, 0], null), !0, Bp, new Ri(null, new m(null, 2, ["v1.2", null, "v2.1", null], null), null), ""), BL(Pw, "Positive nodes", mx, new m(null, 4, [Ll, 0, yx, 100, fD, 1, Qq, 0], null), !0, kl, new Ri(null, new m(null, 2, ["v1.2", null, "v2.1", null], null), null), ""), BL(tC, "Micrometastases only", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bm, "Yes"], null), new R(null, 2, 5, S, [cF, "No"], null)], null), !0, kl, new Ri(null, new m(null, 2, ["v2.1", null, "research", null], null), null), ho), BL(SB, "ER status", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bm, "Positive"], null), new R(null, 2, 5, S, [cF, "Negative"], null)], null), !1, kl, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), null), BL(Tp, "HER2 status", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bm, "Positive"], null), new R(null, 2, 5, S, [cF, "Negative"], null)], null), !0, kl, new Ri(null, new m(null, 4, ["next-gen", null, "v1.2", null, "v2.1", null, "research", null], null), null), null), BL(Kt, "Ki-67 status", Wl, new R(null, 2, 5, S, [new R(null, 2, 5, S, [Bm, "Positive"], null), new R(null, 2, diff --git a/app/controllers/admin/cancerpredicts_controller.rb b/app/controllers/admin/cancerpredicts_controller.rb index b3abb99..3dbc1e4 100644 --- a/app/controllers/admin/cancerpredicts_controller.rb +++ b/app/controllers/admin/cancerpredicts_controller.rb @@ -1,7 +1,7 @@ # encoding: utf-8 require 'rubyXL' class Admin::CancerpredictsController < OrbitAdminController - include Admin::CancerpredictsHelper + #include Admin::CancerpredictsHelper before_action ->(module_app = @app_title) { set_variables module_app } #before_action :load_access_levels def initialize diff --git a/app/controllers/cancerpredicts_controller.rb b/app/controllers/cancerpredicts_controller.rb new file mode 100644 index 0000000..0812c49 --- /dev/null +++ b/app/controllers/cancerpredicts_controller.rb @@ -0,0 +1,27 @@ +# encoding: utf-8 +require 'rubyXL' +class CancerpredictsController < ApplicationController + before_filter :set_I18n + before_action ->(module_app = @app_title) { set_variables module_app } + #before_action :load_access_levels + def initialize + super + @app_title = "cancerpredict" + end + + def index + uid = OrbitHelper.params[:uid] rescue "" + tags = OrbitHelper.widget_tags + categories = OrbitHelper.widget_categories || [] + locale = OrbitHelper.get_site_locale.to_s + end + def widget + uid = OrbitHelper.params[:uid] rescue "" + tags = OrbitHelper.widget_tags + categories = OrbitHelper.widget_categories || [] + locale = OrbitHelper.get_site_locale.to_s + end + def set_I18n + I18n.locale = params[:lang] if params[:lang].present? + end +end \ No newline at end of file diff --git a/app/views/cancerpredicts/index.html.erb b/app/views/cancerpredicts/index.html.erb new file mode 100644 index 0000000..648b75c --- /dev/null +++ b/app/views/cancerpredicts/index.html.erb @@ -0,0 +1 @@ +<%= render_view %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 2cd82fa..b4b6017 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -11,7 +11,7 @@ en: HER2: HER2 status PR: PR status Tumoursize: Tumour size(mm) - Tumourgrade :Tumour grade + Tumourgrade: Tumour grade lymphnodes: lymph nodes positive: positive negative: negative diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index ad59eaa..7dc965c 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -1,8 +1,8 @@ zh_tw: cancerpredict: cancerpredict: 乳癌預測 - table: - welcome:歡迎使用台灣準備乳癌癒後系統!\n若要開始 請在下方輸入相關資訊 + table: + welcome: 歡迎使用台灣準備乳癌癒後系統!\n若要開始 請在下方輸入相關資訊 Reset: 重置 Submit: 提交 age: 確認年齡 @@ -11,7 +11,7 @@ zh_tw: HER2: HER2狀態 PR: PR狀態 Tumoursize: 腫瘤大小(mm) - Tumourgrade :腫瘤分級 + Tumourgrade: 腫瘤分級 lymphnodes: 淋巴結數目 positive: 陽性 negative: 陰性 diff --git a/lib/cancerpredict/engine.rb b/lib/cancerpredict/engine.rb index 6aa69c1..4747a8e 100644 --- a/lib/cancerpredict/engine.rb +++ b/lib/cancerpredict/engine.rb @@ -9,11 +9,12 @@ module Cancerpredict authorizable widget_methods ["widget"] widget_settings [{"data_count"=>1}] + frontend_enabled side_bar do head_label_i18n 'cancerpredict.cancerpredict', icon_class: "icons-megaphone" available_for "users" active_for_controllers (['admin/cancerpredicts']) - head_link_path "admin_cancerPredicts_path" + head_link_path "admin_cancerpredicts_path" context_link 'cancerpredict.cancerpredict', :link_path=>"admin_cancerpredicts_path" , diff --git a/modules/cancerpredict/_cancer_predict_widget.html.erb b/modules/cancerpredict/_cancer_predict_widget.html.erb new file mode 100644 index 0000000..e7cfe43 --- /dev/null +++ b/modules/cancerpredict/_cancer_predict_widget.html.erb @@ -0,0 +1,20 @@ +
+ + + +

+ {{widget-title}} +

+
+
+
+
+
+
 
+
Loading...
+
+
+
+
+
+
\ No newline at end of file diff --git a/modules/cancerpredict/cancer_predict_index.html.erb b/modules/cancerpredict/cancer_predict_index.html.erb new file mode 100644 index 0000000..56f76aa --- /dev/null +++ b/modules/cancerpredict/cancer_predict_index.html.erb @@ -0,0 +1,16 @@ +
+ + + +

{{page-title}}

+
+
+
+
+
 
+
Loading...
+
+
+
+
+
\ No newline at end of file diff --git a/modules/cancerpredict/info.json b/modules/cancerpredict/info.json new file mode 100644 index 0000000..7b4c1d1 --- /dev/null +++ b/modules/cancerpredict/info.json @@ -0,0 +1,22 @@ +{ + "frontend": [ + { + "filename" : "cancer_predict_index", + "name" : { + "zh_tw" : "1. 乳癌預測工具", + "en" : "1. Breast cancer predict tool" + }, + "thumbnail" : "thumb.png" + } + ], + "widgets" : [ + { + "filename" : "cancer_predict_widget", + "name" : { + "zh_tw" : "1. 乳癌預測工具", + "en" : "1. Breast cancer predict tool" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file diff --git a/modules/cancerpredict/thumbs/thumb.png b/modules/cancerpredict/thumbs/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..266af5606742714c262a949cd58aedc2b84b1959 GIT binary patch literal 4075 zcmcgvYdBPE`=8Q@or=MZk}-~jIXD}qFebzhVvsZ#jA2HMW=0OFFbKQkR5@2;7{)1- z&=wM+oMYofvU8{uIS&7&UHkuj*w_2v{qU~qTI;!=weH`2-_Lz|o)v3@JtZh0Apin_ z1kKIRw!l~h+!g!w0MC|jUMDb!Q%!MHJBk;Th7Tlwj65ms1cm?>ZoCb zunI6C_z=xP0tt2@SbL8Ul825b)X)H;M@Iny{0US%gzoQ04nooOq2J}A0DAj1918i) zLM7=#|1t_^Wdkvx1QH+`FocQ+LK6wmREHte5jyHR$`Dlq5&=i5!Vy|3NCZkl3xz;J zeq2yMTcD>G$`+0Jp$nMlLw%^!02CZfqtReAH5et(8;;b`(SajW;i{@C0EbEt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