summaryrefslogtreecommitdiff
path: root/views/model.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/model.haml')
-rw-r--r--views/model.haml88
1 files changed, 55 insertions, 33 deletions
diff --git a/views/model.haml b/views/model.haml
index 79287f0..5addcb0 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -1,64 +1,86 @@
- uri = url_for("/model/#{model.id}", :full)
-- js = "$('#delete_#{model.id}').deleteModel('DELETE', {elem: '#model_#{model.id}'});\n " + "$('#show_model_#{model.id}_warnings').toggleWarnings('#{model.id}');"
+- js = "$('#delete_#{model.id}').deleteModel('DELETE', {id: '#{model.id}'});\n " + "$('#show_model_#{model.id}_warnings').toggleWarnings('#{model.id}');\n"
:javascript
$(function() {
#{js}
});
-%div{:id => "model_#{model.id}"}
- %h2
- = model.name
-
+%div{:id => "model_#{model.id}"}
+ %div{:id => "model_#{model.id}_name"}
+ = haml :model_name, :locals=>{:model=>model}, :layout => false
.model
%dl
%dt Status:
%dd
- %span{:id => "model_#{model.id}_status", :class => model.status}
- = haml :model_status, :locals=>{:model=>model}, :layout => false
- (
- %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete'} delete
- )
- %dt Started:
- %dd= model.created_at.strftime("%m/%d/%Y - %I:%M:%S%p")
- %dt Training compounds:
- %dd= model.nr_compounds
- %dt Warnings:
- - if model.warnings == ''
- %dd -
- - else
+ %span{:id => "model_#{model.id}_status", :class => "model_status"}
+ = haml :model_status, :locals=>{:model=>model}, :layout => false
+ - if model.task_uri && model.status !~ /Completed|Cancelled|Error|Deleting/
+ - if (task = OpenTox::Task.exist?(model.task_uri))
+ %input{:type => 'hidden', :id => "model_#{model.id}_task", :value => "#{model.task_uri}"}
+ - percentage_completed = task.metadata[OT.percentageCompleted].to_i
+ - js = "$('#model_#{model.id}_progress').progressbar({ value: #{percentage_completed} })";
+ :javascript
+ $(function() {
+ #{js}
+ });
+
+ %div{:id => "model_#{model.id}_progress", :class => "model_progress", :title => "#{percentage_completed}%", :alt => "#{percentage_completed}%"}
+ //= haml :model_progress, :locals=>{:percentage_completed=>percentage_completed}, :layout => false
+ - if is_authorized(model.web_uri, "DELETE")
+ %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'}
+ - if model.status == "Completed"
+ (delete)
+ - else
+ (stop)
+ %span
+ %br
+
+ -#%dt Started:
+ -#%dd= model.created_at.strftime("%m/%d/%Y - %I:%M:%S%p")
+ - if model.nr_compounds
+ %dt Training compounds:
+ %dd= model.nr_compounds
+ - if model.error_messages
+ %dt Errors:
+ %dd= model.error_messages
+ - if model.warnings
+ %dt Warnings:
%a{:href => "#", :id => "show_model_#{model.id}_warnings"} show
%dd{:id => "model_#{model.id}_warnings", :style => "display: none;"}= model.warnings
-
- - if model.status == 'Completed'
- %dt Algorithm:
- %dd
- = toggle_link("#lazar_description","lazar")
+ %dt Algorithm:
+ %dd= toggle_link("#lazar_description","lazar")
+ - if model.type
%dt Type:
%dd= toggle_link("##{model.type}","#{model.type}")
- %dt Descriptors:
- %dd
- %a{:href => 'http://www.maunz.de/libfminer2-bbrc-doc/'} Fminer backbone refinement classes
+ %dt Descriptors:
+ %dd
+ %a{:href => 'http://www.maunz.de/libfminer2-bbrc-doc/'} Fminer backbone refinement classes
+ - if model.training_dataset
%dt Training dataset:
%dd
- %a{:href => "#{model.training_dataset}.xls"} Excel sheet
+ %a{:href => "#{model.training_dataset}.xls#{subjectstring}"} Excel sheet
,
-#%a{:href => "#{model.training_dataset}.rdf"} RDF/XML
-#%em (experts) ,
- %a{:href => "#{model.training_dataset}.yaml"} YAML
+ %a{:href => "#{model.training_dataset}.yaml#{subjectstring}" } YAML
%em (experts)
+ - if model.feature_dataset
%dt Feature dataset:
%dd
-#%a{:href => "#{model.feature_dataset}.rdf"} RDF/XML
-#,
- %a{:href => "#{model.feature_dataset}.yaml"} YAML
- %em (experts, dataset too large for Excel)
+ %a{:href => "#{model.feature_dataset}.xls#{subjectstring}"} Excel sheet
+ ,
+ %a{:href => "#{model.feature_dataset}.yaml#{subjectstring}"} YAML
+ %em (experts)
+ - if model.uri
%dt Model:
%dd{:id => "model_qmrf_#{model.id}"}
%input{ :id => "model_validation_qmrf_#{model.id}", :type => "hidden", :value => "#{model.validation_qmrf_status}", :class => "model_validation_qmrf" }
-#%a{:href => "#{model.uri}.rdf"} RDF/XML
-#,
- - unless model.validation_qmrf_uri.nil?
+ - if model.validation_qmrf_uri
%a{:href => File.join(model.validation_qmrf_uri,"editor")} QMRF Editor,
- %a{:href => "#{model.uri}.yaml"} YAML
+ %a{:href => "#{model.uri}.yaml#{subjectstring}"} YAML
%em (experts, models cannot be represented in Excel)
- = haml :validation, :locals=>{:model=>model}, :layout => false
+ = haml :validation, :locals=>{:model=>model,:subjectstring => subjectstring}, :layout => false