diff options
author | gebele <gebele@in-silico.ch> | 2018-05-28 09:12:06 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2018-05-28 09:12:06 +0000 |
commit | 82f8396b1e2fcf72e584ea746c4d4c675b95284f (patch) | |
tree | f11cf907ede4b9023182812c863c251897ec26f7 | |
parent | fa1137da0ed761f37d38b0cdd6002cb07fda99b9 (diff) |
default link color;neighbors and batch details modal;table word wrap
-rw-r--r-- | application.rb | 17 | ||||
-rw-r--r-- | views/batch.haml | 4 | ||||
-rw-r--r-- | views/details.haml | 28 | ||||
-rw-r--r-- | views/style.scss | 4 |
4 files changed, 46 insertions, 7 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 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; |