diff options
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 18 |
1 files changed, 14 insertions, 4 deletions
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 |