summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-02-01 15:35:08 +0100
committergebele <gebele@in-silico.ch>2016-02-01 15:35:08 +0100
commiteb9f19e89e34eb4d573b67d9a2a7ad45ea71f393 (patch)
treeeb3a8cecdcf512c13b39575cbd4bb43ee289ae28 /views
parent443938e6ab6ac2aaade63bc1c51b7da1ebd960dd (diff)
top scroll, tox colum changes, added ID links
Diffstat (limited to 'views')
-rw-r--r--views/layout.haml5
-rw-r--r--views/prediction.haml56
2 files changed, 38 insertions, 23 deletions
diff --git a/views/layout.haml b/views/layout.haml
index 23d251c..12d908f 100644
--- a/views/layout.haml
+++ b/views/layout.haml
@@ -7,7 +7,6 @@
%title Nano Lazar Toxicity Predictions
%link{:rel=>'icon', :type=>'image/x-icon', :href=>'/images/favicon.ico'}
%link{:rel=>'stylesheet', :href=>"#{'/css/style.css'}"}
- %link{:rel=>'stylesheet', :href=>"#{'/css/style2.css'}"}
%link{:rel=>'stylesheet', :href=>"#{'/css/bootstrap.min.css'}"}
%link{:rel=>'stylesheet', :href=>"#{'/css/theme.bootstrap.min.css'}"}
%link{:rel=>'stylesheet', :href=>"#{'/css/theme.default.min.css'}"}
@@ -15,9 +14,9 @@
%script{:src=>"/javascripts/jquery.tablesorter.min.js"}
%script{:src=>"/javascripts/jquery.tablesorter.widgets.js"}
%script{:src=>"/javascripts/jquery.tablesorter.staticrow.min.js"}
- -#%script{:src=>"/javascripts/jquery.doubleScroll.js"}
- %script{:src=>"/javascripts/widget-scroller.js"}
+ %script{:src=>"/javascripts/jquery.doubleScroll.js"}
%script{:src=>"/javascripts/bootstrap.min.js"}
+ %script{:src=>"/javascripts/nanolazar.js"}
%body
%noscript
%div{ :style=>"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"}
diff --git a/views/prediction.haml b/views/prediction.haml
index 9385fa7..8a7c28d 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -11,25 +11,21 @@
$(document).ready(function(){
$(".tablesorter").tablesorter({
debug: false,
- //theme: "bootstrap",
+ theme: "bootstrap",
headerTemplate: '{content} {icon}',
- widgets: ['filter', 'staticRow', 'scroller'],
+ widgets: ['uitheme', 'staticRow', 'stickyHeaders'],
widgetOptions: {
- scroller_upAfterSort: true,
- scroller_jumpToHeader: true,
- scroller_height : 300,
- scroller_fixedColumns : 4,
- scroller_addFixedOverlay : false,
- scroller_barWidth : null
+ stickyHeaders_xScroll : null
},
sortList: [[1,1]],
widthFixed: false,
});
+ $('#neighbors').doubleScroll();
});
- #neighbors
- %table.tablesorter{:id=>"fixed-columns-table"}
+ #neighbors.table-responsive
+ %table.tablesorter
%thead
%tr
%th
@@ -38,8 +34,8 @@
Similarity
%th
Composition
- %th
- Tox
+ %th.tox
+ Toxicity
- @input.each do |key|
%th.physchem
= key[0].gsub(/\sMean/, '')
@@ -49,7 +45,8 @@
/ id
%td
- if @prediction[:match]
- %h5= @prediction[:match].keys[0]
+ %a{:href=> $ambit_search+@prediction[:match].keys[0], :rel=>"external"}
+ %h5= @prediction[:match].keys[0]
- else
%h5 Query
/ similarity
@@ -61,9 +58,18 @@
/ composition
%td
- if @prediction[:match]
+ - surfaceModifier = {}
+ - surfaceModifier["Surface modifier"] = [@prediction[:match].values[0]["composition"]["Surface modifier1"], @prediction[:match].values[0]["composition"]["Surface modifier2"]]
+ - @prediction[:match].values[0]["composition"].delete("Surface modifier1")
+ - @prediction[:match].values[0]["composition"].delete("Surface modifier2")
+ - @prediction[:match].values[0]["composition"].merge!(surfaceModifier)
- @prediction[:match].values[0]["composition"].each do |k,v|
%h5= k
- %p= v
+ - if v.class == Array
+ - v.compact.each do |value|
+ %p= value
+ - else
+ %p= v
- else
%h5 x
/ tox
@@ -71,7 +77,7 @@
- if @prediction[:prediction]
- @prediction[:prediction].each do |k,v|
%h5 Prediction
- %p= k
+ %p= k.split.drop(1).join(" ")[1..-2]
- if v == nil
%p 0
- else
@@ -80,7 +86,7 @@
- @prediction[:match].values[0]["tox"].each do |k,v|
%hr
%h5 Measurement
- %p= k
+ %p= k.split.drop(1).join(" ")[1..-2]
%p= v.round(3)
- if !@prediction[:prediction] && !@prediction[:match]
%h5 x
@@ -109,20 +115,30 @@
%tr
/ ID
%td
- %h5= neighbor["id"]
+ %a{:href=> $ambit_search+neighbor["id"], :rel=>"external"}
+ %h5= neighbor["id"]
/ Similarity
%td
%h5= neighbor["similarity"].round(3)
/ Composition
%td
+ - surfaceModifier = {}
+ - surfaceModifier["Surface modifier"] = [neighbor["composition"]["Surface modifier1"], neighbor["composition"]["Surface modifier2"]]
+ - neighbor["composition"].delete("Surface modifier1")
+ - neighbor["composition"].delete("Surface modifier2")
+ - neighbor["composition"].merge!(surfaceModifier)
- neighbor["composition"].each do |k,v|
%h5= k
- %p= v
+ - if v.class == Array
+ - v.compact.each do |value|
+ %p= value
+ - else
+ %p= v
/ Tox
- %td
+ %td.tox
- neighbor["tox"].each do |k,v|
%h5 Measurement
- %p= k
+ %p= k.split.drop(1).join(" ")[1..-2]
%p= v.round(3)
/ Physchem
- sorted = {}