From 82f8396b1e2fcf72e584ea746c4d4c675b95284f Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 28 May 2018 09:12:06 +0000 Subject: default link color;neighbors and batch details modal;table word wrap --- application.rb | 17 +++++++++++++++-- views/batch.haml | 4 +++- views/details.haml | 28 ++++++++++++++++++++++++++++ views/style.scss | 4 ---- 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 views/details.haml 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 = "" smiles = compound.smiles type = (model.regression? ? "Regression" : "Classification") - html = "" - html += "" + html = "
#{image}
#{smiles}
" + html += "" string = "
#{details}
#{smiles}
" 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 diff --git a/views/batch.haml b/views/batch.haml index e532e9d..8057a6e 100644 --- a/views/batch.haml +++ b/views/batch.haml @@ -134,4 +134,6 @@ }; }); #data-container{:id=>idx,:style=>"width:100%;"} - -#pager{:id=>idx} +%div.modal.fade{:id=>"details", :role=>"dialog"} + %div.modal-dialog.modal-lg + %div.modal-content diff --git a/views/details.haml b/views/details.haml new file mode 100644 index 0000000..be4948a --- /dev/null +++ b/views/details.haml @@ -0,0 +1,28 @@ +:javascript + $(document).ready(function(){ + addExternalLinks(); + }); +%div.modal-body{:style=>"padding:10px;"} + %button.close{ :type=>" button", data: { dismiss:"modal"}} × + %h3 + Names and synonyms: + %p= @compound.svg + %p + %b="SMILES:" + %p= @smiles + %br + %b="InChI:" + %p= @inchi + %br + %b="Names:" + %p{:style=>"padding-left:0.5em;"} + - if @names !~ /^no names/i + = @names.join("; ") + - else + = @names + %hr + %p{:style=>"padding-left:0.5em;"} + / pubchem link + %a.btn.btn-primary{:href=>"http://aop.in-silico.ch/", :title=>"Link opens in new window.", :alt=>"pubchem read across", :rel=>"external"} PubChem read across + %i (experimental) + %br diff --git a/views/style.scss b/views/style.scss index fc6f8f2..235ffcf 100644 --- a/views/style.scss +++ b/views/style.scss @@ -26,10 +26,6 @@ } body { background-color:#E7E7E7; - - a { - color: inherit; - } } table.table-borderless tbody tr td{ border-top: none; -- cgit v1.2.3