diff options
author | gebele <gebele@in-silico.ch> | 2013-03-11 14:55:20 +0100 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-03-11 14:55:20 +0100 |
commit | 56448ff9ab7e9cb1b6f55116765d6315876120b4 (patch) | |
tree | 6d7ad073dc832e3506bddb61e1a985ae6e7af50a /views | |
parent | b5f22735b2f73456a885b2961be8556df62589f2 (diff) |
first version
Diffstat (limited to 'views')
-rw-r--r-- | views/layout.haml | 6 | ||||
-rw-r--r-- | views/predict.haml | 24 | ||||
-rw-r--r-- | views/prediction.haml | 155 |
3 files changed, 107 insertions, 78 deletions
diff --git a/views/layout.haml b/views/layout.haml index d5a14c2..e9aeac5 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -5,10 +5,14 @@ %meta{'http-equiv' => "X-UA-Compatible", :content => "chrome=1"} %title Lazar Toxicity Predictions %link{ :href=>"/stylesheets/screen.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"} - %script{:src=>"http://code.jquery.com/jquery-1.8.3.js"} + %link{:rel=>"stylesheet", :href=>"http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css"} + %script{:src=>"http://code.jquery.com/jquery-1.9.1.js"} + %script{ :src=>"http://code.jquery.com/ui/1.10.0/jquery-ui.js"} + %body .logo + %img{:src=>"/images/ist_logo.png"} %h1 Lazar Toxicity Predictions .info diff --git a/views/predict.haml b/views/predict.haml index 31bd4ed..60817da 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -7,10 +7,10 @@ %form{:name => "form", :action => to('/predict'), :method => "post", :enctype => "multipart/form-data" } %fieldset#top - %a{:href => "#insert", :id => "linkInsert#{p.object_id}"} + %a{:href => "#insert", :id => "linkInsert"} %h1 1. Draw or insert your compound :javascript - $("a#linkInsert#{p.object_id}").click(function () { + $("a#linkInsert").click(function () { $("#insert").toggle(); document.location = document.location + "#" + "insert"; }); @@ -40,24 +40,26 @@ %fieldset#middle - %a{:href => "#models", :id => "linkModels#{p.object_id}"} + %a{:href => "#models", :id => "linkModels"} %h1 2. Select one or more toxic endpoints :javascript - $("a#linkModels#{p.object_id}").click(function () { + $("a#linkModels").click(function () { $("#models").toggle(); document.location = document.location + "#" + "models"; }); #models{ :style => "display: none;"} - %p Description about these models. + %p Please observe validation report for details. %br - @models.each do |model| - model.get - %input{:type => 'checkbox', :name => "selection[#{model.title}]", :value => true, :disabled => false} - %p= model.title - %p= model.metadata[RDF::DC.modified] - %br + #model + %input{:type => 'checkbox', :name => "selection[#{model.title}]", :value => true, :disabled => false} + %b= model.title + %a{:href=>"#", :alt=>"#{model.title} validation"} + %i Validation Link + %br .close = hide_link "#models" @@ -67,11 +69,11 @@ %fieldset#bottom - %a{:href => "#predict", :id => "linkPredict#{p.object_id}"} + %a{:href => "#predict", :id => "linkPredict"} %h1 3. Predict :javascript - $("a#linkPredict#{p.object_id}").click(function () { + $("a#linkPredict").click(function () { $("#predict").toggle(); document.location = document.location + "#" + "predict"; }); diff --git a/views/prediction.haml b/views/prediction.haml index 48a55ce..c75b132 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -1,3 +1,8 @@ +:javascript + $(function() { + $("#tabs").tabs(); + }); + .predictions .back %h1 @@ -5,72 +10,90 @@ %a{:href => to('/predict')} New Prediction - + %script{:src=>"/javascripts/jquery.tablesorter.min.js"} + .results %h2= "Selected Entpoints: " - - @prediction_models.each do |m| - %a{:href => "#results_#{m.title}", :id => "link#{m.title}"} - = m.title - :javascript - $("a#link#{m.title}").click(function () { - $("#results_#{m.title}").toggle(); - }); - - #results{:id=>"#{m.title}", :style=>"display: none"} - %h2= "Prediction Uri: " - - @predictions.each do |p| - %p= p.uri - - - %h2= "Predicted Compound: " - - @prediction_compound.each do |compound| - %img{:src=>"#{compound.uri}/image", :alt=>compound.uri, :width=>"100px"} - %p= compound.smiles - - %h2= "Prediction: " - - @prediction_values.each do |p| - %p= p[1] - %h2= "Confidence: " - %p= p[2] - - %script{:src=>"/javascripts/jquery-latest.js"} - %script{:src=>"/javascripts/jquery.tablesorter.min.js"} - -#%script{:src=>"/javascripts/jquery.metadata.js"} - - :javascript - $(document).ready(function(){ - // call the tablesorter plugin - $("table").tablesorter({ - widgets: ['zebra'], - // disable first column - headers: { - 0: {sorter: false} - }, - }); - }); - - %h3= "Neighbours: " - %table{:class=>"tablesorter", :cellspacing=>"1"} - %thead - %tr - %th - = "compound" - %th - = "smiles" - %th - = "measured activity" - %th - = "similarity" - -#%tbody - - count = 0 - - @prediction_neighbours_compounds.each do |neighbour_compound| - %tr - %td - %img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"} - %td= neighbour_compound.smiles - -#%h2= "Measured Activity: " - %td= @prediction_neighbours_values[0][count][0].inspect - -#%h2= "Smilarity: " - %td= @prediction_neighbours_values[0][count][3].inspect - - count += 1 + #tabs + %ul + - count_m = 0 + - @prediction_models.each do |m| + - count_m += 1 + %li + %a{:href => "#results_#{count_m}", :id => "link#{m.title}"} + = m.title + - count_rs = 0 + - @predictions.each do |pa| + - count_rs += 1 + #results{:id=>"#{count_rs}"} + - pa.each do |p| + / get prediction OpenTox::Dataset + - p.get + - compound = p.compounds[0] + %table{:class=>"result", :cellspacing=>"1"} + %thead + %tr + %th + = "Compound" + %th + = "SMILES" + %th + = "Result" + %th + = "Confidence" + %tbody + %tr + %td + %img{:src=>"#{compound.uri}/image", :alt=>compound.uri, :width=>"100px"} + %td + %p= compound.smiles + -#%td + -#%h2= "Prediction Uri: " + -#%p= p.uri + %td + %p= p.data_entries[0][1] + %td + %p= p.data_entries[0][2] + + / prepare dataset for neighbours table + - p.data_entries.shift + - p.compounds.shift + :javascript + $(document).ready(function(){ + // call the tablesorter plugin + $("table##{count_rs}").tablesorter({ + // debug for development + debug: true, + widgets: ['zebra'], + // disable first column + headers: { + 0: {sorter: false} + }, + }); + }); + / TODO catch table error if tbody is empty + %h3= "Neighbours: " + #tableinfo + hold down shift for multi-sort + %table{:id=>"#{count_rs}", :class=>"tablesorter", :cellspacing=>"1"} + %thead + %tr + %th + = "Compound" + %th + = "Smiles" + %th + = "Measured Activity" + %th + = "Similarity" + -#%tbody + - count = 0 + - p.compounds.each do |neighbour_compound| + %tr + %td + %img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"} + %td= neighbour_compound.smiles + %td= p.data_entries[count][0] + %td= p.data_entries[count][3] + - count += 1 |