summaryrefslogtreecommitdiff
path: root/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'application.rb')
-rw-r--r--application.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index 8223bbe..bd2ae54 100644
--- a/application.rb
+++ b/application.rb
@@ -70,10 +70,11 @@ get '/task/?' do
compound = Compound.find prediction_object.compound
model = Model::Validation.find prediction_object.model
image = compound.svg
+ details = "<a class=\"btn btn-link\" data-id=\"details\" data-remote=\"#{to('/prediction/')+compound.id}/details\" data-toggle=\"modal\" href=\"#details\" #{image}</a>"
smiles = compound.smiles
type = (model.regression? ? "Regression" : "Classification")
- html = "<table class=\"table table-bordered single-batch\"><tr>"
- html += "<td>#{image}</br>#{smiles}</br></td>"
+ html = "<table class=\"table table-bordered single-batch\" style=\"word-wrap:break-word;table-layout:fixed;\"><tr>"
+ html += "<td>#{details}</br>#{smiles}</br></td>"
string = "<td><table class=\"table\">"
sorter = []
if prediction[:info]
@@ -129,6 +130,18 @@ get '/predict/modeldetails/:model' do
return haml :model_details, :layout=> false, :locals => {:model => model, :crossvalidations => crossvalidations}
end
+get '/prediction/:compound/details/?' do
+ @compound = Compound.find params[:compound]
+ @smiles = @compound.smiles
+ begin
+ @names = @compound.names.nil? ? "No names for this compound available." : @compound.names
+ rescue
+ @names = "No names for this compound available."
+ end
+ @inchi = @compound.inchi.gsub("InChI=", "")
+ haml :details, :layout => false
+end
+
get '/jme_help/?' do
File.read(File.join('views','jme_help.html'))
end