From 12002a6390b10c3c12462936484ba967da2478e4 Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 10 Mar 2015 16:58:49 +0100 Subject: marked links >;resize body if large table;setup sdf --- views/neighbors.haml | 4 ++-- views/predict.haml | 23 +++++++++++++---------- views/prediction.haml | 15 +++++++++++---- views/style.scss | 6 +++--- 4 files changed, 29 insertions(+), 19 deletions(-) (limited to 'views') diff --git a/views/neighbors.haml b/views/neighbors.haml index 603f920..33ea688 100644 --- a/views/neighbors.haml +++ b/views/neighbors.haml @@ -98,7 +98,7 @@ %tr %td.compound %a{:href => to("/prediction/#{CGI.escape(neighbor_compound.uri)}/details"), :id=>"link#{count_rs}#{count}", :target=>"details"} - Names and synonymes + Names and synonymes > %img{:src=>"#{neighbor_compound.uri}/image", :alt=>"Compound image not available", :title=>"#{neighbor_compound.smiles}", :width=>"150px"} %td - if c.class == String @@ -110,7 +110,7 @@ %td - if @type =~ /classification/i - if p.data_entries[count][3] != nil - %a{:href => to("/prediction/#{CGI.escape(@model_uri)}/#{@type}/#{CGI.escape(neighbor_compound.uri)}/significant_fragments"), :id=>"link#{count_rs}#{count}sf", :target=>"details"} Significant fragments + %a{:href => to("/prediction/#{CGI.escape(@model_uri)}/#{@type}/#{CGI.escape(neighbor_compound.uri)}/significant_fragments"), :id=>"link#{count_rs}#{count}sf", :target=>"details"} Significant fragments > - if @type =~ /regression/i - if p.data_entries[count][3] != nil %a{:href => to("/prediction/#{CGI.escape(@model_uri)}/#{@type}/#{CGI.escape(neighbor_compound.uri)}/significant_fragments"), :id=>"link#{count_rs}#{count}sf", :target=>"details"} Descriptors diff --git a/views/predict.haml b/views/predict.haml index bed0837..b37d6ab 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -14,9 +14,9 @@ function checksmiles () { if (document.form.identifier.value == "") { alert("Please draw or insert a chemical structure."); - //$("img.circle").hide(); + $("img.circle").hide(); document.form.identifier.focus(); - $('#progressBar').hide(); + //$('#progressBar').hide(); return false; }; return true; @@ -30,8 +30,8 @@ }); if (checked == false){ alert("Please select an endpoint."); - //$("img.circle").hide(); - $('#progressBar').hide(); + $("img.circle").hide(); + //$('#progressBar').hide(); return false; }; return true; @@ -48,9 +48,9 @@ document.form.identifier.value = document.JME.smiles() ; }; }; - //function showcircle(){ - //$("img.circle").show(); - //}; + function showcircle(){ + $("img.circle").show(); + }; // whole site content needs to be in one form. Input and checkboxes are proofed by js functions. %form{:name => "form", :action => to('/predict'), :method => "post", :enctype => "multipart/form-data", :onsubmit => "return !!(checksmiles() & checkboxes())" } @@ -130,10 +130,12 @@ %br %p{:style=>"display:inline"}= "Feature Dataset: " %a{:href=>"#{to("/predict/#{CGI.escape(model[RDF::OT.featureDataset])}")}", :title=>"download"} rdf + -#%a{:href=>"#{to("/predict/#{CGI.escape(model[RDF::OT.featureDataset])}")}/sdf", :title=>"download"} sdf %br %br %p{:style=>"display:inline"}= "Training Dataset: " %a{:href=>"#{to("/predict/#{CGI.escape(model[RDF::OT.trainingDataset])}")}", :title=>"link opens in new window."} rdf + -#%a{:href=>"#{to("/predict/#{CGI.escape(model[RDF::OT.trainingDataset])}/sdf")}", :title=>"link opens in new window."} sdf %br - unless model.metadata[RDF::OT.crossValidation].nil? %h3 Validation: @@ -153,8 +155,9 @@ %h1 3. Predict %td{:style=>"width:10%;align:center;valign:middle;"} - %input{ :type => "submit", :id => "submit", :value=>">>", :onclick => "(progress(1,$('#progressBar')) & getsmiles() & checkboxes())", :style=>"cursor: pointer;display:inline;width:50px;height:50px;border-radius: 50%;color:#2b2b2b;text-align:center;text-decoration:none;background:#f76700;box-shadow: 0 0 5px white;font-weight:bold;"} + %input{ :type => "submit", :id => "submit", :value=>">>", :onclick => "(showcircle() & getsmiles() & checkboxes())", :style=>"cursor: pointer;display:inline;width:50px;height:50px;border-radius: 50%;color:#2b2b2b;text-align:center;text-decoration:none;background:#f76700;box-shadow: 0 0 5px white;font-weight:bold;"} %td{:style=>"align:center;valign:middle;"} - #progressBar{:style=>"width: 400px;height: 22px;border:1px solid #2b2b2b;background-color:gray;display:none;"} - #bar{:style =>"width:0;height: 100%;color: #fff;text-align: right;line-height: 22px;background-color: #0099ff;"} + %img{:src=>"/images/wait30trans.gif", :class=>"circle", :style=>"display:none;background-color:white;margin-left:10%;border:solid 1px;vertical-align:middle;"} + -##progressBar{:style=>"width: 400px;height: 22px;border:1px solid #2b2b2b;background-color:gray;display:none;"} + -##bar{:style =>"width:0;height: 100%;color: #fff;text-align: right;line-height: 22px;background-color: #0099ff;"} diff --git a/views/prediction.haml b/views/prediction.haml index 0bd0ea9..99b7527 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -1,3 +1,10 @@ +:javascript + // increase body width if more than 2 models selected + window.onload = function(){ + var plusSize = ("#{@predictions.size}" > 2 ) ? ("#{@predictions.size}" * 100) : 0; + var width = $(window).width() + plusSize; + $("body").width(width); + }; .predictions .back %h1 @@ -14,9 +21,9 @@ %tbody %tr - %td{:id=>"compound", :style=>"width: 200px;vertical-align:top;"} + %td{:id=>"compound", :style=>"vertical-align:top;"} %a{:href => to("/prediction/#{CGI.escape(@compound.uri)}/details"), :id=>"linkCompound", :target=>"details_overview"} - Names and synonyms + Names and synonyms > %img{:src=>"#{@compound.uri}/image", :alt=>"Compound image not available", :title=>"#{@compound.smiles}", :width=>"150", :height=>"150"} %p :javascript @@ -118,7 +125,7 @@ /TODO add tooltip for significant ftagments and descriptors - if @model_type[count] =~ /classification/i && (p.data_entries[0][1] != nil && p.data_entries[0][1] != 0.0) / Significant fragments: - %a{:href => to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[count]}/#{CGI.escape(@compound.uri)}/fingerprints"), :id=>"linkPredictionSf", :title=>"", :target=>"details_overview"}Significant fragments + %a{:href => to("/prediction/#{CGI.escape(@model_uri)}/#{@model_type[count]}/#{CGI.escape(@compound.uri)}/fingerprints"), :id=>"linkPredictionSf", :title=>"", :target=>"details_overview"}Significant fragments > :javascript $(function() { $("a#linkPredictionSf").on('click', function(e) { @@ -137,7 +144,7 @@ %p - if c != '' %a{:href=> "#tabs", :id=>"link#{count}"} - %b Neighbors + %b Neighbors > :javascript $("a#link#{count}").click(function () { $(".results").show(); diff --git a/views/style.scss b/views/style.scss index a068ab1..4021d1f 100644 --- a/views/style.scss +++ b/views/style.scss @@ -105,8 +105,8 @@ body { border: 1px solid #dad9c7; padding-left: 1em; padding-top: 0.5em; } - .content .overview #overview tr td #compound { - width: 200px; } + .content .overview #overview tr td#compound { + width: 250px; } .content .overview #overview tr td b.c { color: #d42200; } .content .overview #overview tr td b.n { @@ -207,7 +207,7 @@ body { box-shadow: (1px 1px 1px rgba(white, 1) inset, -1px -1px 5px rgba($black, 0.3) inset); padding-left: 1em; } .results .tablesorter tbody .compound { - width: 200px; + width: 250px; padding: 0.2em; } .results .tablesorter tbody .n { color: #5c8533; } -- cgit v1.2.3