summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-08-22 16:25:21 +0000
committerChristoph Helma <helma@in-silico.ch>2011-08-22 16:25:21 +0000
commita8f6072f32ef5ae650216a4612d13eeb6b310c7e (patch)
tree60cb79d76b74c94b46201038c260e083a626806f
parentf5eccd4ce22acb2fa05e84fb80e8385cce235d51 (diff)
parent4fc732ca31b07ba1469358836abf6ffd3c955098 (diff)
Merge branch 'development' of github.com:opentox/toxcreate into development
-rw-r--r--application.rb8
-rwxr-xr-xpublic/javascripts/toxcreate.js14
-rw-r--r--views/model.haml18
-rw-r--r--views/models.haml6
-rw-r--r--views/validation.haml2
5 files changed, 23 insertions, 25 deletions
diff --git a/application.rb b/application.rb
index eb86916..9ef50f8 100644
--- a/application.rb
+++ b/application.rb
@@ -92,8 +92,7 @@ end
get '/models/?' do
@models = ToxCreateModel.all.sort(:order => "DESC")
@models.each{|m| raise "internal redis error: model is nil" unless m}
- subjectstring = @subjectid ? "?subjectid=#{CGI.escape(@subjectid)}" : ""
- haml :models, :locals=>{:models=>@models, :subjectstring => subjectstring}
+ haml :models, :locals=>{:models=>@models}
end
get '/model/:id/status/?' do
@@ -156,13 +155,12 @@ end
get '/model/:id/:view/?' do
response['Content-Type'] = 'text/plain'
model = ToxCreateModel.get(params[:id])
- subjectstring = @subjectid ? "?subjectid=#{CGI.escape(@subjectid)}" : ""
begin
case params[:view]
when "model"
- haml :model, :locals=>{:model=>model,:subjectstring => subjectstring}, :layout => false
+ haml :model, :locals=>{:model=>model}, :layout => false
when /validation/
- haml :validation, :locals=>{:model=>model,:subjectstring => subjectstring}, :layout => false
+ haml :validation, :locals=>{:model=>model}, :layout => false
else
return "unable to render model: id #{params[:id]}, view #{params[:view]}"
end
diff --git a/public/javascripts/toxcreate.js b/public/javascripts/toxcreate.js
index ee783ce..0e82040 100755
--- a/public/javascripts/toxcreate.js
+++ b/public/javascripts/toxcreate.js
@@ -18,20 +18,20 @@ $(function() {
return this.replace(/^\s+|\s+$/g, '');
}
- checkStati = function(stati, subjectstr) {
+ checkStati = function(stati) {
stati = stati.split(", ");
$("body")
var newstati = new Array;
$.each(stati, function(){
- checkProgress(this, subjectstr);
- if(checkStatus(this, subjectstr) > 0) newstati.push(this);
+ checkProgress(this);
+ if(checkStatus(this) > 0) newstati.push(this);
});
- if (newstati.length > 0) var statusCheck = setTimeout('checkStati("' + newstati.join(", ") + '", "' + subjectstr + '")',10000);
+ if (newstati.length > 0) var statusCheck = setTimeout('checkStati("' + newstati.join(", ") + '")',10000);
};
- checkStatus = function(id, subjectstr) {
+ checkStatus = function(id) {
if(id == "") return -1;
- var opts = {method: 'get', action: 'model/' + id + '/status' + subjectstr, id: id};
+ var opts = {method: 'get', action: 'model/' + id + '/status', id: id};
var status_changed = $.ajax({
type: opts.method,
url: opts.action,
@@ -62,7 +62,7 @@ $(function() {
};
- checkProgress = function(id, subjectstr) {
+ checkProgress = function(id) {
var task = $("input#model_" + id + "_task").attr('value');
var opts = {action: task + "/percentageCompleted" , id: id};
var progress_changed = $.ajax({
diff --git a/views/model.haml b/views/model.haml
index f0fd660..356ec65 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -65,26 +65,26 @@
%dt Training dataset:
%dd
- if model.training_dataset.match(/ambit/i)
- %a{:href => "#{model.training_dataset}#{subjectstring}", :rel => "external"} Ambit database
+ %a{:href => "#{model.training_dataset}", :rel => "external"} Ambit database
- else
- %a{:href => "#{model.training_dataset}.xls#{subjectstring}"} Excel sheet
+ %a{:href => "#{model.training_dataset}.xls"} Excel sheet
,
-#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
-#%em (experts) ,
- %a{:href => "#{model.training_dataset}.sdf#{subjectstring}" } SDF
+ %a{:href => "#{model.training_dataset}.sdf" } SDF
,
- %a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
+ %a{:href => "#{model.training_dataset}.yaml" } YAML
%em (experts)
- if model.feature_dataset
%dt Feature dataset:
%dd
-#%a{:href => "#{model.feature_dataset}.rdf"} RDF/XML
-#,
- %a{:href => "#{model.feature_dataset}.xls#{subjectstring}"} Excel sheet
+ %a{:href => "#{model.feature_dataset}.xls"} Excel sheet
,
- %a{:href => "#{model.feature_dataset}.sdf#{subjectstring}"} SDF
+ %a{:href => "#{model.feature_dataset}.sdf"} SDF
,
- %a{:href => "#{model.feature_dataset}.yaml#{subjectstring}"} YAML
+ %a{:href => "#{model.feature_dataset}.yaml"} YAML
%em (experts)
- if model.uri
%dt Model:
@@ -94,7 +94,7 @@
-#,
- if model.validation_qmrf_uri
%a{:href => File.join(model.validation_qmrf_uri,"editor")} QMRF Editor,
- %a{:href => "#{model.uri}.yaml#{subjectstring}"} YAML
+ %a{:href => "#{model.uri}.yaml"} YAML
%em (experts, models cannot be represented in Excel)
- = haml :validation, :locals=>{:model=>model,:subjectstring => subjectstring}, :layout => false
+ = haml :validation, :locals=>{:model=>model}, :layout => false
diff --git a/views/models.haml b/views/models.haml
index 9ab2858..a1ef8ba 100644
--- a/views/models.haml
+++ b/views/models.haml
@@ -3,7 +3,7 @@
:javascript
$(function() {
if(#{stati != 0}) {
- setTimeout('checkStati("#{stati_to_check}", "#{subjectstring}")',5000);
+ setTimeout('checkStati("#{stati_to_check}", "")',5000);
}
var reload_validation = true;
});
@@ -20,6 +20,6 @@
- if @models
- @models.each do |model|
- = haml :model, :locals=>{:model=>model,:subjectstring=>subjectstring}, :layout => false
--if @models.size == 0
+ = haml :model, :locals=>{:model=>model}, :layout => false
+-if @models.size == 0
.notice There are currently no models. You have to create a model first.
diff --git a/views/validation.haml b/views/validation.haml
index b8a6eaa..0a094d6 100644
--- a/views/validation.haml
+++ b/views/validation.haml
@@ -7,7 +7,7 @@
- if model.validation_report_uri
%dt Detailed report:
%dd
- %a{:href => model.validation_report_uri + subjectstring, :target => "_blank"} show
+ %a{:href => model.validation_report_uri, :target => "_blank"} show
%dt Number of predictions:
%dd= model.nr_predictions.to_s
- case model.type