From 954791e63129f2b0219db126bfd654440198e64d Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 16 Jan 2017 15:01:18 +0000 Subject: adjusted possible input by core --- views/layout.haml | 14 +++++++------- views/predict.haml | 46 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 14 deletions(-) (limited to 'views') diff --git a/views/layout.haml b/views/layout.haml index f36bdf7..e81bd21 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -22,18 +22,18 @@ %noscript %div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"} Your web browser must have JavaScript enabled in order for this application to display correctly. - %header.page-header{:style=>"margin:20px 0 20px;text-align:justify;display:inline-block;width:100%;"} - %div.row + %header.page-header{:style=>"margin:20px 0 20px;"} + %div.row{:style=>"display:flex;flex-direction:row;align-items:center;justify-content:center"} %div.col-sm-2 %a{:href=> to("/predict")} - %img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo_ist", :width=>"150px", :heigth=>"150px", :style=>"margin:0 0 0 2em;"} + %img.media-object{:src=>"/images/IST_logo_s.png", :alt=>"logo_ist", :width=>"150px", :heigth=>"150px", :style=>"margin:0 0 0 1em;"} %div.col-sm-2 %a{:href=> "http://www.enanomapper.net"} - %img.media-object{:src=>"/images/enm_logo.png", :width=>"200px", :heigth=>"200px", :alt=>"logo_enm", :style=>"margin:0 3em 0 0;"} + %img.media-object{:src=>"/images/enm_logo.png", :width=>"150px", :heigth=>"150px", :alt=>"logo_enm", :style=>"margin:0 0 0 1em;"} %div.col-sm-6 - %h1.media-heading{:style=>"margin: 0 0 0 1em;"} nano-lazar toxicity predictions - %div.col-md-2 - %h1.media-heading{:style=>"margin: 0 0 0 1em;"} + %h1.media-heading{:style=>"margin:0 0 0 1em;"} nano-lazar toxicity predictions + %div.col-sm-2 + %h1.media-heading{:style=>"margin:0 0 0 1em;"} %small %a{:href=>"https://lazar.in-silico.ch/predict", :rel=>"external"} lazar diff --git a/views/predict.haml b/views/predict.haml index e54f8b4..a438f7f 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -1,8 +1,43 @@ :javascript + + $(window).bind("pageshow", function(event) { + $("img.circle").hide(); + }); + function showcircle() { $("img.circle").show(); }; - + $(document).ready(function(){ + $('#selCore1').change(function(){ + var selection = $(this).val(); + switch(selection){ + case "Ag": + $("#physchem1").prop('disabled', false); + $("#physchem2").prop('disabled', false); + $("#physchem3").prop('disabled', true); + $("#physchem4").prop('disabled', true); + $("#physchem5").prop('disabled', true); + $("#physchem6").prop('disabled', false); + $("#physchem7").prop('disabled', true); + $("#physchem8").prop('disabled', true); + $("#physchem9").prop('disabled', true); + $("#physchem10").prop('disabled', true); + break; + case "Au": + $("#physchem1").prop('disabled', false); + $("#physchem2").prop('disabled', false); + $("#physchem3").prop('disabled', false); + $("#physchem4").prop('disabled', false); + $("#physchem5").prop('disabled', false); + $("#physchem6").prop('disabled', false); + $("#physchem7").prop('disabled', false); + $("#physchem8").prop('disabled', false); + $("#physchem9").prop('disabled', false); + $("#physchem10").prop('disabled', false); + break; + }; + }); + }); %div.well %h3.help-block @@ -149,16 +184,13 @@ %div.form-group %label{:for=>"selCore#{idx}"} Core %select.form-control{:id=>"selCore#{idx}", :autocomplete=>"off", :name=>"input_core",:value=>example.core["name"]} - //%option{:selected => "selected", :value => "-- select a core --", :style=>"display:none;"} %option{:selected => ("selected" if example.core["name"] == "Ag"), :value => "Ag"} Ag %option{:selected => ("selected" if example.core["name"] == "Au"), :value => "Au"} Au - //%option{:value => "Ag"} Ag - //%option{:value => "Au"} Au // coating //%h5 Coating //%input.input-sm.form-control{:id=>"coating",:type=>"text",:disabled=>"disabled",:name=>"coating",:value=>example.coating[0]["name"]} - %input.input-sm.form-control{:id=>"coating",:type=>"hidden",:name=>"input_coating",:value=>example.coating[0]["name"]} + //%input.input-sm.form-control{:id=>"coating",:type=>"hidden",:name=>"input_coating",:value=>example.coating[0]["name"]} // relevant features - relevant_features.sort_by{|f| f.name}.each_with_index do |relf,id| @@ -176,7 +208,7 @@ %a.descriptor{:href=>$npo[feature.name], :rel=>"external"}= name + (feature.unit.blank? ? "" : " (#{feature.unit})") // input physchem parameters - %input.input-sm.form-control{:id=>"#{id}",:type=>"text",:name=>"input_value_#{id}",:value=>"#{val[0]}"} + %input.input-sm.form-control{:id=>"physchem#{id}",:type=>"text",:name=>"input_value_#{id}",:value=>"#{val[0]}", :disabled=>("disabled" if val[0].blank?)} %input{:id=>id,:type=>"hidden",:name=>"input_key_#{id}",:value=>feature.id} - if type =~ /proteomics/ @@ -202,7 +234,7 @@ // coating //%h5 Coating //%input.input-sm.form-control{:id=>"coating",:type=>"text",:disabled=>"disabled",:name=>"coating",:value=>example.coating[0]["name"]} - %input.input-sm.form-control{:id=>"coating",:type=>"hidden",:name=>"input_coating",:value=>example.coating[0]["name"]} + //%input.input-sm.form-control{:id=>"coating",:type=>"hidden",:name=>"input_coating",:value=>example.coating[0]["name"]} // relevant features - relevant_features.sort_by{|f| f.name}.each_with_index do |relf,id| -- cgit v1.2.3