From f86c084311282036ffa7b4588c0fa0d5b59af95b Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 24 Nov 2016 16:03:09 +0000 Subject: several fixes; works with lazar tree e111369ce5564f159b3f5f85c92afdd22352eaa1 --- application.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index b9c267c..5f64b84 100644 --- a/application.rb +++ b/application.rb @@ -1,5 +1,5 @@ #require_relative 'helper.rb' -#require 'rdiscount' +require 'rdiscount' include OpenTox #require File.join(ENV["HOME"],".opentox","config","lazar-gui.rb") # until added to ot-tools @@ -20,20 +20,24 @@ helpers do end +before do + @version = File.read("VERSION").chomp +end + get '/?' do redirect to('/predict') end get '/predict/?' do - @version = File.read("VERSION").chomp @models = OpenTox::Model::Prediction.all + @models = @models.delete_if{|m| m.model.name =~ /\b(Net cell association)\b/} @endpoints = @models.collect{|m| m.endpoint}.sort.uniq @models.count <= 0 ? (haml :info) : (haml :predict) end get '/predict/modeldetails/:model' do model = OpenTox::Model::Prediction.find params[:model] - crossvalidations = model.crossvalidations + crossvalidations = OpenTox::Validation::RepeatedCrossValidation.find(model.repeated_crossvalidation_id).crossvalidations #confidence_plots = crossvalidations.collect{|cv| [cv.id, cv.confidence_plot]} #confidence_plots.each do |confp| # File.open(File.join('public', "confp#{confp[0]}.svg"), 'w'){|file| file.write(confp[1])} unless File.exists? File.join('public', "confp#{confp[0]}.svg") @@ -45,7 +49,7 @@ get '/predict/modeldetails/:model' do # end #end - return haml :model_details, :layout=> false, :locals => {:model => model} + return haml :model_details, :layout=> false, :locals => {:model => model, :crossvalidations => crossvalidations} end get '/jme_help/?' do @@ -305,6 +309,12 @@ post '/predict/?' do haml :prediction end end + +get '/license' do + @license = RDiscount.new(File.read("LICENSE.md")).to_html + haml :license, :layout => false +end + =begin get '/faq' do @faq = RDiscount.new(File.read("FAQ.md")).to_html -- cgit v1.2.3