diff options
author | gebele <gebele@in-silico.ch> | 2013-04-09 16:50:56 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-04-09 16:50:56 +0200 |
commit | c74da4b41e6413d126ae8d6aa62874627cb14fca (patch) | |
tree | 96e8d75a655704d0a63ab3a51c46ab173c4d37dd /views | |
parent | b983a694fca22d53054a90ddb894f33be365e5a8 (diff) |
adjusted for services update
Diffstat (limited to 'views')
-rw-r--r-- | views/details.haml | 3 | ||||
-rw-r--r-- | views/layout.haml | 27 | ||||
-rw-r--r-- | views/neighbours.haml | 12 | ||||
-rw-r--r-- | views/predict.haml | 2 | ||||
-rw-r--r-- | views/prediction.haml | 11 |
5 files changed, 40 insertions, 15 deletions
diff --git a/views/details.haml b/views/details.haml index 48d28bc..ff77783 100644 --- a/views/details.haml +++ b/views/details.haml @@ -4,14 +4,13 @@ .details %h2 Details: - %img{:src=>"#{@compound_uri.uri}/image", :alt=>@compound_uri.uri, :width=>"100px"} + %img{:src=>"#{@compound_uri.uri}/image", :alt=>"", :width=>"100px"} %br %b SMILES: %p= @smiles %br %b - // TODO handle OpenTox::ResourceNotFoundError Names: %p= @names %br diff --git a/views/layout.haml b/views/layout.haml index 7c05190..b6606a1 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -20,7 +20,32 @@ %h1 Lazar Toxicity Predictions %hr - .content + .content + :javascript + $(document).ready(function(){ + // hide #back-top first + $("#back-top").hide(); + // fade in #back-top + $(function () { + $(window).scroll(function () { + if ($(this).scrollTop() > 400) { + $('#back-top').fadeIn(); + } else { + $('#back-top').fadeOut(); + } + }); + // scroll body to 0px on click + $('#back-top a').click(function () { + $('body,html').animate({ + scrollTop: 0 + }, 500); + return false; + }); + }); + }); + #back-top + %a{:href => ""}^ top ^ + = yield .footer diff --git a/views/neighbours.haml b/views/neighbours.haml index a593e7b..7d99288 100644 --- a/views/neighbours.haml +++ b/views/neighbours.haml @@ -29,7 +29,7 @@ #results{:id=>"#{count_rs}"} - pa.each do |p| / get prediction OpenTox::Dataset - - p.get + -# p.get / prepare dataset for neighbours table ; / delete first array which contains input compound prediction ; / keep the following arrays they are the neighbour predictions ; @@ -64,12 +64,12 @@ - p.compounds.each do |neighbour_compound| %tr %td - %img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"} - %td{:class => p.data_entries[count][0]} - = p.data_entries[count][0] - %td{:class => p.data_entries[count][0]} + %img{:src=>"#{neighbour_compound.uri}/image", :alt=>"", :width=>"100px"} + %td{:class => p.data_entries[count][2]} + = p.data_entries[count][2] + %td{:class => p.data_entries[count][2]} = p.data_entries[count][3].round(3) - %td{:class => p.data_entries[count][0]} + %td{:class => p.data_entries[count][2]} %a{:href => to("/prediction/#{CGI.escape(neighbour_compound.uri)}/details"), :id=>"link#{count_rs}#{count}", :target=>"details"} %img{:src=>"/images/arrow_right_float.png", :alt=>"arrow"} :javascript diff --git a/views/predict.haml b/views/predict.haml index b53acb6..82f7bbc 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -1,4 +1,5 @@ :javascript + function getsmiles() { if (document.JME.smiles() != '') { document.form.identifier.value = document.JME.smiles() ; @@ -71,7 +72,6 @@ %p Please observe validation report for details. %br - @models.each do |model| - - model.get #model %input{:type => "checkbox", :name => "selection[#{model.title}]", :id => "selection[#{model.title}]", :value => true, :disabled => false} %label{:for => "selection[#{model.title}]"} diff --git a/views/prediction.haml b/views/prediction.haml index dd90847..02b3ab1 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -14,21 +14,22 @@ %tbody %tr %td{:id=>"compound"} - %img{:src=>"#{@compound.uri}/image", :alt=>@compound.uri, :width=>"100"} + %img{:src=>"#{@compound.uri}/image", :alt=>"image not available", :width=>"100"} - count=0 - @@predictions.each do |pa| - pa.each do |p| - - p.get - %td{:class => p.data_entries[0][1]} + -# p.get + %td{:class => p.data_entries[0][0]} %b{:class => "title"} = @@prediction_models[count].title %br + - $logger.debug "p.data_entries: #{p.data_entries}" %br = "Result:\n" - %b= p.data_entries[0][1] + %b= p.data_entries[0][0] %br = "Confidence:\n" - = p.data_entries[0][2].round(3) + = p.data_entries[0][1].round(3) %br %a{:href=> "#tabs", :id=>"link#{count}"} %img{:src=>"/images/arrow_down_float.png", :alt=>"arrow"} |