From 34b41877160d95da2d7e5b7dec49696070bc169d Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Fri, 22 Nov 2019 17:43:39 +0800 Subject: [PATCH] finish reset_btn and set a submit_btn --- app/assets/javascripts/react.js | 17 ++- index.html.erb | 230 ++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 9 deletions(-) create mode 100644 index.html.erb diff --git a/app/assets/javascripts/react.js b/app/assets/javascripts/react.js index a8c3455..6177713 100644 --- a/app/assets/javascripts/react.js +++ b/app/assets/javascripts/react.js @@ -3026,7 +3026,7 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { QG(function (a) { return Y(IW.c ? IW.c(a) : IW.call(null, a)) }, new R(null, 1, 5, S, [ZG], null), "treatments-received-panel"); QG(function () { return React.createElement("div", { id: "patient-related-help" }, React.createElement("h1", null, "Patient related factors"), React.createElement("h2", null, "<%=%>"), React.createElement("p", null, "Many risk factors depend on the age of the patient."), React.createElement("h2", null, "Surgery", React.createElement("p", null, "May be breast-conserving surgery or a mastectomy."))) }, new R(null, 1, 5, S, [ZG], null), "patient-related-help"); var JW = QG(function (a) { - var b = function () { var a = new m(null, 1, [nu, jW], null); return null/*nW.c ? nW.c(a) : nW.call(null, a) */}();/*important*/ return gg(React.createElement, "div", M(b) ? EG(b) : null, M(b) ? new R(null, 1, 5, S, [React.createElement("form", { onKeyPress: GW, onSubmit: HW, className: "form-horizontal" }, Y(p(a.c ? a.c(fn) : a.call(null, fn)) ? new R(null, 3, 5, S, [bv, function () { var a = new m(null, 2, [Lx, "Age", hk, fn], null); return LT.c ? LT.c(a) : LT.call(null, a) }(), new R(null, 3, 5, S, [bv, new m(null, 1, [Ru, new m(null, 3, [Bn, "#686868", Aq, "145px", wr, -5], null)], + var b = null;/*important*/ return gg(React.createElement, "div", M(b) ? EG(b) : null, M(b) ? new R(null, 1, 5, S, [React.createElement("form", { onKeyPress: GW, onSubmit: HW, className: "form-horizontal" }, Y(p(a.c ? a.c(fn) : a.call(null, fn)) ? new R(null, 3, 5, S, [bv, function () { var a = new m(null, 2, [Lx, "Age", hk, fn], null); return LT.c ? LT.c(a) : LT.call(null, a) }(), new R(null, 3, 5, S, [bv, new m(null, 1, [Ru, new m(null, 3, [Bn, "#686868", Aq, "145px", wr, -5], null)], null), "Age must be between 25 and 85"], null)], null) : null), Y(B.h(Bm, bH(KQ(eo))) ? function () { var a = new m(null, 2, [Lx, "Post Menopausal", hk, Zk], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null))], null) : new R(null, 2, 5, S, [Y(b), React.createElement("form", { onKeyPress: GW, onSubmit: HW, className: "form-horizontal" }, Y(p(a.c ? a.c(fn) : a.call(null, fn)) ? new R(null, 3, 5, S, [bv, function () { var a = new m(null, 2, [Lx, "Age", hk, fn], null); return LT.c ? LT.c(a) : LT.call(null, a) }(), new R(null, 3, 5, S, [bv, new m(null, 1, [Ru, new m(null, 3, [Bn, "#686868", Aq, "145px", wr, -5], null)], null), "Age must be between 25 and 85"], null)], null) : null), Y(B.h(Bm, bH(KQ(eo))) ? function () { var a = new m(null, 2, [Lx, "Post Menopausal", hk, Zk], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null))], null)) }, new R(null, 1, 5, S, [aH], null), "patient-related-form"), KW = QG(function (a) { return Y(JW.c ? JW.c(a) : JW.call(null, a)) }, new R(null, 1, 5, S, [ZG], null), "patient-related-panel"), LW = QG(function (a) { @@ -3044,14 +3044,15 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { null)], null) : null) , Y(p(a.c ? a.c(Tp) : a.call(null, Tp)) ? function () { var a = new m(null, 2, [Lx, "HER2 status", hk, Tp], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null), Y(p(a.c ? a.c(Br) : a.call(null, Br)) ? function () { var a = new m(null, 2, [Lx, "Detected by", hk, Br], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null), Y(B.h(ln, bH(KQ(Br))) ? new R(null, 4, 5, S, [bv, new m(null, 1, [Ru, new m(null, 3, [Bn, "#686868", Aq, "145px", wr, -5], null)], null), "Detected as part of a preventive ", new R(null, 3, 5, S, [eF, new m(null, 2, [CE, "https://www.nhs.uk/conditions/nhs-screening/", $A, "_blank"], null), "screening programme"], null)], null) : null), Y(p(a.c ? a.c(Pw) : a.call(null, Pw)) ? new R(null, 6, 5, S, [bv, function () { var a = new m(null, 2, [Lx, "Positive nodes", hk, Pw], null); return LT.c ? LT.c(a) : LT.call(null, a) }(), function () { var a = new m(null, 2, [Lx, "Micrometastases only", hk, tC], null); return LT.c ? LT.c(a) : LT.call(null, a) }(), ig("1", b) ? new R(null, 3, 5, S, [bv, new m(null, 1, [Ru, new m(null, 3, [Bn, "#686868", Aq, "145px", wr, -5], null)], null), "Enabled when positive nodes is 1. "], null) : null, B.h("1", b) ? LW.c ? LW.c("“Yes” means the positive node has micrometastases only") : LW.call(null, "“Yes” means the positive node has micrometastases only") : null, B.h("0", b) ? LW.c ? LW.c("Why can't I enter micrometastases?") : LW.call(null, "Why can't I enter micrometastases?") : null], null) : null)) - }, new R(null, 2, 5, S, [aH, ZG], null), "tumour-related-form"), NW = QG(function (a) { return Y(MW.c ? MW.c(a) : MW.call(null, a)) }, new R(null, 1, 5, S, [ZG], null), "tumour-related-panel"),reset_btn = QG(function (a) { a = null != a && (a.v & 64 || h === a.J) ? P(Fi, a) : a; a = y.h(a, nu);console.log(a);return React.createElement("button", { onClick: a, className: "btn navbar-btn btn-danger btn-lg screen-only" }, " Reset ") }, new R(null, 1, 5, S, [ZG], null), "clear-all-button"), OW = QG(function (a) { + }, new R(null, 2, 5, S, [aH, ZG], null), "tumour-related-form"), NW = QG(function (a) { return Y(MW.c ? MW.c(a) : MW.call(null, a)) }, new R(null, 1, 5, S, [ZG], null), "tumour-related-panel"),submit_btn = QG(function (a) { a = null != a && (a.v & 64 || h === a.J) ? P(Fi, a) : a; a = y.h(a, nu);return React.createElement("button", { onClick: function(){console.log(p(LG))}, className: "submit-btn screen-only",style:{marginLeft:'1em',float:'right',backgroundColor:"#d26900",color:"white",border:"0em",padding:"0.125em 0.5em",borderRadius:"0.5em"} }, " Submit ") }, new R(null, 1, 5, S, [ZG], null), "clear-all-button"),reset_btn = QG(function (a) { a = null != a && (a.v & 64 || h === a.J) ? P(Fi, a) : a; a = y.h(a, nu);return React.createElement("button", { onClick: a, className: "reset-btn screen-only",style:{float:'right',backgroundColor:"#d26900",color:"white",border:"0em",padding:"0.125em 0.5em",borderRadius:"0.5em"} }, " Reset ") }, new R(null, 1, 5, S, [ZG], null), "clear-all-button"), reset_call = QG(function (a) { + var b = function () { var a = new m(null, 1, [nu, jW], null); return reset_btn.c ? reset_btn.c(a) : reset_btn.call(null, a)}(),b1 = function () { var a = new m(null, 1, [nu, jW], null); return submit_btn.c ? submit_btn.c(a) : submit_btn.call(null, a)}();/*important*/ return gg(React.createElement, "div", M(b) ? EG(b) : null, [Y(b1),Y(b)])}), OW = QG(function (a) { return React.createElement("form", { onKeyPress: GW, onSubmit: HW, className: "form-horizontal" },Y(p(a.c ? a.c(vu) : a.call(null, vu)) ? function () { var a = new m(null, 2, [Lx, "Size", hk, vu], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null), Y(p(a.c ? a.c(Qw) : a.call(null, Qw)) ? function () { var a = new m(null, 2, [Lx, "Grade", hk, Qw], null); return LT.c ? LT.c(a) : LT.call(null, a) }() : null)) }, new R(null, 1, 5, S, [ZG], null), "hormone-form"), PW = QG(function (a) { return Y(OW.c ? OW.c(a) : OW.call(null, a)) }, new R(null, 1, 5, S, [ZG], null), "hormone-panel"), QW = QG(function () { var a = FW(); return React.createElement("div", { className: "row" }, React.createElement("div", { style: { paddingRight: 0 }, className: "col-sm-6 screen-only" }, Y(KW.c ? KW.c(a) : KW.call(null, a)), Y(PW.c ? PW.c(a) : PW.call(null, a))), React.createElement("div", { style: { paddingRight: 0 }, className: "col-sm-6 screen-only" }, Y(NW.c ? NW.c(a) : NW.call(null, - a))),React.createElement("div",{className: "col-sm-6 screen-only"},React.createElement("div",{},Y(reset_btn.l ? reset_btn.l() : reset_btn.call(null))))) + a)))) }, new R(null, 2, 5, S, [aH, tU], null), "inputs-row"); QG(function () { var a = FW(); return React.createElement("div", { className: "row" }, React.createElement("div", { style: { paddingRight: 0 }, className: "col-sm-12" }, Y(KW.c ? KW.c(a) : KW.call(null, a)), Y(NW.c ? NW.c(a) : NW.call(null, a)), Y(PW.c ? PW.c(a) : PW.call(null, a)))) }, new R(null, 2, 5, S, [aH, tU], null), "inputs-column"); BT(fg(zT, T, new R(null, 2, 5, S, [new R(null, 2, 5, S, ["div", new m(null, 1, [Do, "12px"], null)], null), new R(null, 3, 5, S, [".treatments-header--G__28384", new m(null, 3, [dr, "rgba(255, 140, 0, 1) !important", Bn, "white !important", Do, "0.625em !important"], null), new R(null, 2, 5, S, ["form", new m(null, 1, [eC, "1px solid red"], null)], null)], null)], null)), "predict3.layout.treatments-panel", "treatments-style"); BT(fg(zT, T, new R(null, 1, 5, S, [new R(null, 2, 5, S, [".closer--G__28387", new m(null, 1, [YD, "0.625em"], null)], null)], null)), "predict3.layout.treatments-panel", "treatment-input-style"); var RW = QG(function (a, b) { @@ -3103,8 +3104,8 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { React.createElement("p", null, "Should ", React.createElement("strong", null, "bisphosphonates"), " be included as a treatment option in this tool? "), Y(OQ(eo)), React.createElement("p", null, "If bisphosphonates are not available as a treatment in your area, you may wish to remove this treatment\n option from the tool."), React.createElement("hr", null), React.createElement("p", null, "Should the tool cover ", React.createElement("strong", null, "10 or 15 years"), " from diagnosis?"), Y(OQ(lm)), React.createElement("hr", null), React.createElement("p", null, "Which ", React.createElement("strong", null, "result tab"), " should appear first?"), Y(OQ(NB))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", onClick: function () { return $("#settingsModal").modal("hide") }, className: "btn btn-default" }, "Close"))))) }, new R(null, 1, 5, S, [aH], null), "settings-modal"); var $W = QG(function () { return Y(p(bH(FQ)) ? function () { sU("tool-postamble"); return new R(null, 4, 5, S, [gB, new m(null, 4, [ps, "button", nu, function () { return zQ.ma(null, "print") }, lC, function (a) { return B.h("Enter", a.nativeEvent.code) ? zQ.ma(null, "print") : null }, Ru, ni([Bn, Do, cp, dr, Fr, xt, $t, Gx, jy, xz, Uz], ["#ffffff", 16, 300, "#444466", 70, 10, 10, .5, "0.9375em 5px 0.9375em 5px", -1, "fixed"])], null), function () { var a = new m(null, 1, [Qm, DF], null); return XQ.h ? XQ.h(a, "print") : XQ.call(null, a, "print") }(), " Print"], null) }() : null) }, new R(null, - 1, 5, S, [aH], null), "results-footer"), aX = QG(function () { - var a = bH(FQ); return cc(E(a)) || null == a ? React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-sm-10 col-sm-offset-1 col-xs-12" }, React.createElement("div", { style: { backgroundColor: "#d3e7fd", padding: "0.625em 0.625em 3px 0.625em", marginBottom: 20 } }, React.createElement("div", { style: { color: "#002e5d", fontSize: "1.25em" } }, React.createElement("p", { style: { paddingBottom: 0 } }, Y(function () { + 1, 5, S, [aH], null), "results-footer"),is_submit={flag: true , submit_func: function(){var a = bH(FQ);return (cc(E(a)) || null == a)}} , aX = QG(function () { + var a = bH(FQ); console.log(cc(E(a)) || null == a);return is_submit.flag ? React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-sm-10 col-sm-offset-1 col-xs-12" }, React.createElement("div", { style: { backgroundColor: "#d3e7fd", padding: "0.625em 0.625em 3px 0.625em", marginBottom: 20 } }, React.createElement("div", { style: { color: "#002e5d", fontSize: "1.25em" } }, React.createElement("p", { style: { paddingBottom: 0 } }, Y(function () { var a = new m(null, 2, [Qm, DF, Ru, new m(null, 2, [Do, 35, iu, 8], null)], null); return XQ.h ? XQ.h(a, "info-circle") : XQ.call(null, a, "info-circle") }()), " Treatment options and results will appear here when you have filled in all the information needed above."))))) : React.createElement("div", null, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md-6 clearfix" }, React.createElement("h3", null, "Treatment Options"), Y(VW.l ? VW.l() : VW.call(null))), function () { @@ -3117,10 +3118,8 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { React.createElement("div", { key: 2, className: "row" }, React.createElement("div", { style: { marginBottom: 20 }, className: "col-xs-12" }, Y(QW.l ? QW.l() : QW.call(null)))))), React.createElement("div", { className: "row screen-only" }, React.createElement("div", { style: { backgroundColor: "#ffffff" }, className: "col-sm-12" }, React.createElement("div", { key: 3, className: "row" }, React.createElement("div", { key: 2, className: "col-sm-10 col-sm-offset-1" }, Y(aX.l ? aX.l() : aX.call(null)))))), Y(uU(0)), function () { var a = $W.l ? $W.l() : $W.call(null); return gg(React.createElement, "div", M(a) ? EG(rG(C([new m(null, 1, [Rx, new R(null, 1, 5, S, ["screen-only"], null)], null), a]))) : { className: "screen-only" }, M(a) ? new R(null, 1, 5, S, [null], null) : new R(null, 2, 5, S, [Y(a)], null)) - }(), Y(WW.l ? WW.l() : WW.call(null)), Y(ZW.l ? ZW.l() : ZW.call(null)), Y(YW.l ? YW.l() : YW.call(null))], null) : new R(null, 9, 5, S, [Y(b), /*React.createElement("div", { id: "main-content", tabIndex: -1, style: { marginLeft: -30, marginRight: -30 }, className: "row" }, - React.createElement("div", { className: "col-xs-12" }, React.createElement("div", { style: { position: "relative", width: "100%", backgroundColor: "#d3e7fd" } }, React.createElement("div", { style: { position: "absolute", width: "100%", top: 0, bottom: "20%", opacity: .25, background: "linear-gradient(rgba(255,255,255,0), #fff)" } }), React.createElement("div", - { className: "row print-only" }, gg(React.createElement, "div", M(a) ? EG(rG(C([new m(null, 1, [Rx, new R(null, 2, 5, S, ["col-sm-10", "col-sm-offset-1"], null)], null), a]))) : { className: "col-sm-10 col-sm-offset-1" }, M(a) ? null : new R(null, 1, 5, S, [Y(a)], null)))))),*//*important*/ React.createElement("div", { className: "row screen-only" }, React.createElement("div", { className: "col-md-10 col-md-offset-1" }, React.createElement("div", { key: 2, className: "row" }, React.createElement("div", { style: { marginBottom: 20 }, className: "col-xs-12" }, Y(QW.l ? QW.l() : - QW.call(null)))))),React.createElement("div", { className: "row screen-only" },Y(reset_btn.l ? reset_btn.l() : reset_btn.call(null))), React.createElement("div", { className: "row screen-only" }, React.createElement("div", { style: { backgroundColor: "#ffffff" }, className: "col-sm-12" }, React.createElement("div", { key: 3, className: "row" }, React.createElement("div", { key: 2, className: "col-sm-10 col-sm-offset-1" }, Y(aX.l ? aX.l() : aX.call(null)))))), Y(uU(0)), function () { + }(), Y(WW.l ? WW.l() : WW.call(null)), Y(ZW.l ? ZW.l() : ZW.call(null)), Y(YW.l ? YW.l() : YW.call(null))], null) : new R(null, 9, 5, S, [Y(b), React.createElement("div", { className: "row screen-only" }, React.createElement("div", { className: "col-md-10 col-md-offset-1" }, React.createElement("div", { key: 2, className: "row" }, React.createElement("div", { style: { marginBottom: 20 }, className: "col-xs-12" }, Y(QW.l ? QW.l() : + QW.call(null)))))),React.createElement("div",{style:{clear:'both'}},reset_call.l ? reset_call.l() : reset_call.call(null))/*important ! here can add items under the form*/, React.createElement("div", { className: "row screen-only" }, React.createElement("div", { style: { backgroundColor: "#ffffff" }, className: "col-sm-12" }, React.createElement("div", { key: 3, className: "row" }, React.createElement("div", { key: 2, className: "col-sm-10 col-sm-offset-1" }, Y(aX.l ? aX.l() : aX.call(null)))))), Y(uU(0)), function () { var a = $W.l ? $W.l() : $W.call(null); return gg(React.createElement, "div", M(a) ? EG(rG(C([new m(null, 1, [Rx, new R(null, 1, 5, S, ["screen-only"], null)], null), a]))) : { className: "screen-only" }, M(a) ? null : new R(null, 2, 5, S, [/*print button*/Y(a)], null)) }(), Y(WW.l ? WW.l() : WW.call(null)), Y(ZW.l ? ZW.l() : ZW.call(null)), Y(YW.l ? YW.l() : YW.call(null))], null)) diff --git a/index.html.erb b/index.html.erb new file mode 100644 index 0000000..eedb906 --- /dev/null +++ b/index.html.erb @@ -0,0 +1,230 @@ +<% if params[:is_frontend_view] == "true" %> + <% OrbitHelper.render_css_in_head(["basic/icon","lib/orbit_bar/orbit-bar"]) %> +<% else %> + <%= stylesheet_link_tag "basic/icon" %> + <%= stylesheet_link_tag "lib/orbit_bar/orbit-bar" %> +<% end %> +
+ <% if current_user.nil? %> + + + + + <% end %> + +
+ +

+ <%= current_site.mobile_orbit_bar_title.nil? || current_site.mobile_orbit_bar_title == "" ? "Orbit" : current_site.mobile_orbit_bar_title %> +

+ + +
    + <% + google_search_cx = current_site.search['sitesearch'] rescue nil + is_google_seach_cx = google_search_cx =~ /^[0-9]+\:[0-9A-Za-z]+$/ + if !google_search_cx.blank? and is_google_seach_cx + %> +
  • + +
  • + <% + else + if !google_search_cx.blank? and !is_google_seach_cx + search_domain = google_search_cx + else + search_domain = request.host_with_port + end + %> +
  • + +
  • + <% end %> +
  • + <% if current_site.enable_language_options %> + <% if @site_in_use_locales.count > 1 || current_site.enable_zh_cn %> + <% zh_cn_added = 0 %> + <% locale = session[:zh_cn] ? :zh_cn : I18n.locale %> + Language +
      + <% @site_in_use_locales.each do |l| %> + <% + case l + when :en + accesskey = "e" + when :zh_tw + accesskey = "t" + end + %> + <% if l.to_s == I18n.locale.to_s and !session['zh_cn'] %> +
    • "> + <%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %> +
    • + <% else %> +
    • "> + <%= t((l==:zh_tw ? :zh_tw_ : :_locale ), :locale => l) %> +
    • + <% end %> + <% if current_site.enable_zh_cn and zh_cn_added == 0 and !request.path.include?("/admin/") %> + <% zh_cn_added = 1 %> + <% accesskey = "s" %> + <% if locale == :zh_cn %> +
    • + <%= t(:zh_cn, :locale => :zh_tw) %> +
    • + <% else %> +
    • + <%= t(:zh_cn, :locale => :zh_tw) %> +
    • + <% end %> + <% end %> + <% end %> +
    + <% end %> + <% end %> +
  • + <% if !current_user.nil? %> +
  • + <%= current_user.member_profile.name.nil? ? current_user.user_name : current_user.member_profile.name rescue nil %> +
      +
    • <%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"),admin_member_edit_passwd_path(current_user.member_profile.to_param), tabindex: '-1' rescue nil%>
    • +
    • <%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"),admin_member_path(current_user.member_profile.to_param), tabindex: '-1' rescue nil %>
    • + <% if current_user.is_admin? && params[:is_frontend_view] == "true" %> +
    • + <% if params[:editmode] == "on" %> + " style="color:red;">Edit Mode Off + <% else %> + ">Edit Mode On + <% end %> +
    • + <% end %> +
    • + <%= t(:logout) %> +
    • +
    +
  • + <% else %> +
  • + /accesskey" title="Login">::: + +
  • + <% end %> +
+
+
+