diff options
author | gebele <gebele@in-silico.ch> | 2013-04-10 15:27:27 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-04-10 15:27:27 +0200 |
commit | 4e04bd3915ddb25206d68b1060e514fe23d44398 (patch) | |
tree | 988993cc91dc60586ed1488e6d0304beb2b7044e /views/prediction.haml | |
parent | c74da4b41e6413d126ae8d6aa62874627cb14fca (diff) |
catch no result no neigbours
Diffstat (limited to 'views/prediction.haml')
-rw-r--r-- | views/prediction.haml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/views/prediction.haml b/views/prediction.haml index 02b3ab1..1e67cbd 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -3,7 +3,7 @@ %h1 %img{:src=>"/images/arrow_left_float.png", :alt=>"arrow"} %a{:href => to('/predict')} New Prediction - + / displays all prediction results .overview %table{:width=>"100%", :cellspacing=>"1", :id=>"overview"} %thead @@ -16,17 +16,21 @@ %td{:id=>"compound"} %img{:src=>"#{@compound.uri}/image", :alt=>"image not available", :width=>"100"} - count=0 + / var for rule to load neighbours page. + - @@neighbours_available = 1 - @@predictions.each do |pa| + / prediction of one model - pa.each do |p| - -# p.get + / p.data_entries > 1 = neighbours available + - $logger.debug "count data_entries: #{p.data_entries.length}" + - p.data_entries.length > 1 ? @@neighbours_available = p.data_entries.length : @@neighbours_available %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][0] + %b= p.data_entries[0][0] != nil ? p.data_entries[0][0] : "No prediction result" %br = "Confidence:\n" = p.data_entries[0][1].round(3) @@ -41,5 +45,9 @@ }); - count+=1 - = haml :neighbours, :layout => false +- if @@neighbours_available > 1 + = haml :neighbours, :layout => false +- else + %h2 + no neighbours available |