summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-03-21 15:37:28 +0100
committergebele <gebele@in-silico.ch>2013-03-21 15:37:28 +0100
commite18adec09d77c2461ba15a2a5d02734d4015327e (patch)
tree7027953ee1dea1675dcc975c3e8652c9026a713f /views
parent84bb7c7ff4afcb1ad7ad1c68f0eb778c64f63183 (diff)
3bloc result view
Diffstat (limited to 'views')
-rw-r--r--views/details.haml26
-rw-r--r--views/neighbours.haml28
-rw-r--r--views/predict.haml2
-rw-r--r--views/prediction.haml14
4 files changed, 39 insertions, 31 deletions
diff --git a/views/details.haml b/views/details.haml
index ffa347c..028b5b1 100644
--- a/views/details.haml
+++ b/views/details.haml
@@ -1,15 +1,17 @@
%link{ :href=>"/stylesheets/screen.css", :media=>"screen, projection", :rel=>"stylesheet", :type=>"text/css"}
+.content
+ .details
+ %h2
+ Details:
+ %img{:src=>"#{@compound_uri.uri}/image", :alt=>@compound_uri.uri, :width=>"100px"}
+ %p
+ SMILES:
+ = @compound_uri.smiles
-.details
- %img{:src=>"#{@compound.uri}/image", :alt=>@compound.uri, :width=>"100px"}
- %p
- SMILES:
- = @compound.smiles
+ %p
+ // TODO handle OpenTox::ResourceNotFoundError
+ Names:
+ = @compound_uri.names
- %p
- // TODO handle OpenTox::ResourceNotFoundError
- Names:
- = @compound.names
-
- %p
- = @compound.inchi.gsub("InChI=", "InChI: ")
+ %p
+ = @compound_uri.inchi.gsub("InChI=", "InChI: ")
diff --git a/views/neighbours.haml b/views/neighbours.haml
index cb30481..ad22e10 100644
--- a/views/neighbours.haml
+++ b/views/neighbours.haml
@@ -9,14 +9,9 @@
%script{:src=>"http://code.jquery.com/jquery-1.9.1.js"}
%script{ :src=>"http://code.jquery.com/ui/1.10.0/jquery-ui.js"}
%script{:src=>"/javascripts/jquery.tablesorter.min.js"}
-/ main class in stylesheet ;
-.results
+
+.results{:style=>"display:none"}
- count_m = 0
- / js function for tabs div with preseleted tab by link id ;
- :javascript
- $(function() {
- $("#tabs").tabs({ active: '#{params[:id]}' });
- });
/ tabs div ;
#tabs
%ul
@@ -44,14 +39,14 @@
:javascript
$(document).ready(function(){
$("table##{count_rs}").tablesorter({
- debug: true,
+ //debug: true,
widgets: ['zebra'],
headers: {0: {sorter: false},3: {sorter: false}},
sortList: [[2,0]]
});
});
/ TODO catch table error if tbody is empty
- %h3= "Neighbours: "
+ %h2= "Neighbours: "
%table{:id=>"#{count_rs}", :class=>"tablesorter", :cellspacing=>"1"}
%thead
%tr
@@ -69,13 +64,20 @@
%tr
%td
%img{:src=>"#{neighbour_compound.uri}/image", :alt=>neighbour_compound.uri, :width=>"100px"}
- %td= p.data_entries[count][0]
+ %td
+ = p.data_entries[count][0]
%td
= p.data_entries[count][3].round(3)
%td
- / target is iframe "details", defined in prediction.haml
- %a{:href => to("/prediction/#{CGI.escape(neighbour_compound.uri)}/details"), :id=>"link#{neighbour_compound.uri}/#{count}", :target=>"details"}
+ %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
+ $("a#link#{count_rs}#{count}").click(function () {
+ $(".details").toggle();
+ document.getElementById('details').focus();
+ });
+
- count += 1
-
+-#= haml :details, :layout => false
+%iframe{:id=>"details", :name=>"details", :height=>"400px", :width=>"100%", :style=>"border:0px"}
diff --git a/views/predict.haml b/views/predict.haml
index 064ed60..dbfab50 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -30,7 +30,7 @@
$("#insert").toggle();
document.location = document.location + "#" + "insert";
});
- #insert{ :style => "display: none" }
+ #insert{:style=>"display:none"}
%p
%label &nbsp;
.jme
diff --git a/views/prediction.haml b/views/prediction.haml
index 47a4dfa..82c7254 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -29,11 +29,15 @@
= "Confidence:\n"
= p.data_entries[0][2].round(3)
%br
- %a{:href=> to("/prediction/neighbours/#{count}"), :target=> "neighbours"}
+ %a{:href=> "#tabs", :id=>"link#{count}"}
%img{:src=>"/images/arrow_down_float.png", :alt=>"arrow"}
+ :javascript
+ $("a#link#{count}").click(function () {
+ $(".results").toggle();
+ document.getElementById('tabs').focus();
+ $("#tabs").tabs({ active: "#{count}" });
+ });
- count+=1
-
- %iframe{:id=>"neighbours", :name=>"neighbours", :width=>"50%", :height=>"400px", :style=>"float:left; border:0px"}
- %iframe{:id=>"details", :name=>"details", :width=>"50%", :height=>"400px", :style=>"border:0px"}
-
+
+ = haml :neighbours, :layout => false