From 13ffab048630cc30a4af9e9113c1843ae5af0a09 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 25 Sep 2013 00:12:04 +0200 Subject: several major changes in code, several minor changes in style; prepared for OT meeting --- views/significant_fragments.haml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 views/significant_fragments.haml (limited to 'views/significant_fragments.haml') diff --git a/views/significant_fragments.haml b/views/significant_fragments.haml new file mode 100644 index 0000000..7d342d0 --- /dev/null +++ b/views/significant_fragments.haml @@ -0,0 +1,63 @@ +%link{ :href=>"/stylesheets/screen.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"} +/TODO put smiles in div if compound image is not available, prevent overlay to table +.content + %button{:id=>"closebutton", :onclick=>"parent.$('#iframe_details').bPopup().close();parent.$('#iframe_overview').bPopup().close();"} + X +- if @type =~ /classification/i + .significant_fragments{:style=>"padding:0.5em;min-height:400px"} + %h2{:style=>"margin:0px;margin-left:8px;"} + Significant fragments: + + %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"} + - if !@significant_fragments.empty? + %table{:id => "sf1"} + %tr + %th{:style=>"border:1px solid;"} + Predominantly in compounds with activity "non-carcinogen" + %th{:style=>"border:1px solid;"} + p value + - @significant_fragments.each do |fragments| + / fragments == [1||2, smarts, pValue] + - if fragments[0] == 1 + %tr + %td + = fragments[1] + %td + = fragments[2] + %tr + %td + %br + %tr + %th{:style=>"border:1px solid;"} + Predominantly in compounds with activity "carcinogen" + %th{:style=>"border:1px solid;"} + p value + - @significant_fragments.each do |fragments| + / fragments == [1||2, smarts, pValue] + - if fragments[0] == 2 + %tr + %td + = fragments[1] + %td + = fragments[2] + +- if @type =~ /regression/i + .descriptors{:style=>"padding:0.5em;min-height:400px"} + %h2{:style=>"margin:0px;margin-left:8px;"} + Descriptors: + + %img{:src=>"#{@compound.uri}/image", :alt=>"#{@compound.smiles}", :title=>"#{@compound.smiles}", :width=>"300px", :heigth=>"300px"} + - if !@significant_fragments.empty? + %table{:id => "sf2"} + %tr + %th{:style=>"border:1px solid;"} + Descriptor + %th{:style=>"border:1px solid;"} + value + - @significant_fragments.each do |fragments| + %tr + %td + = fragments[0] + %td + = fragments[1][0].round(3) + -- cgit v1.2.3