summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/classification_validation.haml17
-rw-r--r--views/create.haml21
-rw-r--r--views/endpoint.haml2
-rw-r--r--views/model.haml30
-rw-r--r--views/model_echa.haml2
-rw-r--r--views/model_name.haml6
-rw-r--r--views/models.haml13
-rw-r--r--views/models_navigation.haml70
-rw-r--r--views/style.sass30
-rw-r--r--views/validation.haml2
10 files changed, 161 insertions, 32 deletions
diff --git a/views/classification_validation.haml b/views/classification_validation.haml
index 47e1f75..e06cb65 100644
--- a/views/classification_validation.haml
+++ b/views/classification_validation.haml
@@ -5,13 +5,24 @@
%dt
%a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Average area under ROC:
%dd
- = sprintf("%.3f", model.average_area_under_roc.to_f) if model.average_area_under_roc
+ - if model.average_area_under_roc
+ = sprintf("%.3f", model.average_area_under_roc.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Specificity:
-%dd= sprintf("%.3f", model.specificity.to_f) if model.specificity
+%dd
+ - if model.specificity
+ = sprintf("%.3f", model.specificity.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Sensitivity:
-%dd= sprintf("%.3f", model.sensitivity.to_f) if model.sensitivity
+%dd
+ - if model.sensitivity
+ = sprintf("%.3f", model.sensitivity.to_f)
+ - else
+ = 'NA'
%dt
%a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :rel => "external"} Confusion Matrix:
- if model.confusion_matrix
diff --git a/views/create.haml b/views/create.haml
index b706484..da85382 100644
--- a/views/create.haml
+++ b/views/create.haml
@@ -24,6 +24,8 @@
= link_to "SDF", '/help'
format:
%input{:type => 'file', :name => 'file', :id => 'file', :size => '41'}
+ %br
+ -# = haml :model_echa, :layout => false
%input{ :type => "submit", :value => "Create model"}
=# link_to "Cancel", '/create'
@@ -47,15 +49,16 @@
structure-activity models from your experimental data. The models can be used to predict toxicity of new chemicals (e.g. for
%a{:href => "http://ec.europa.eu/environment/chemicals/reach/reach_intro.htm", :rel => "external"} REACH
purposes) and to reduce the need for animal testing. The following methods are currently available:
- %ul
- %li
- = toggle_link("#lazar_description","lazar")
- %em= toggle_link("#classification","classification")
- models and
- %li
- = toggle_link("#lazar_description","lazar")
- %em= toggle_link("#regression","regression")
- models (experimental)
+ %ul
+ %li
+ = toggle_link("#lazar_description","lazar")
+ %em= toggle_link("#classification","classification")
+ models and
+ %li
+ = toggle_link("#lazar_description","lazar")
+ %em= toggle_link("#regression","regression")
+ models (experimental)
+ %p
Further modelling algorithms may be added in future versions.
.login_notice
diff --git a/views/endpoint.haml b/views/endpoint.haml
index af06b80..9c250ca 100644
--- a/views/endpoint.haml
+++ b/views/endpoint.haml
@@ -9,4 +9,4 @@
%em in-vitro,
or
%em in-vivo
- expriment, clinical trial or epidemiological study
+ experiment, clinical trial or epidemiological study
diff --git a/views/model.haml b/views/model.haml
index 266fe19..51a7498 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -25,8 +25,14 @@
});
%div{:id => "model_#{model.id}_progress", :class => "model_progress", :title => "#{percentage_completed}%"}
- //= haml :model_progress, :locals=>{:percentage_completed=>percentage_completed}, :layout => false
-
+ //= 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|Error|Cancelled/
+  (delete)
+ - else
+  (stop)
%span
%br
@@ -38,7 +44,7 @@
- if model.error_messages
%dt Errors:
%dd= model.error_messages
- - if CONFIG[:logger]=="debug"
+ - if CONFIG[:logger]=="debug" && is_aluist
%dt Task:
%dd
%a{:href => "#{model.task_uri}", :id => "model_#{model.id}_task_link", :rel => "external"}
@@ -60,26 +66,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:
@@ -89,7 +95,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/model_echa.haml b/views/model_echa.haml
new file mode 100644
index 0000000..257a28a
--- /dev/null
+++ b/views/model_echa.haml
@@ -0,0 +1,2 @@
+Select an endpoint:
+= endpoint_option_list \ No newline at end of file
diff --git a/views/model_name.haml b/views/model_name.haml
index 874ddaa..19819f4 100644
--- a/views/model_name.haml
+++ b/views/model_name.haml
@@ -5,4 +5,8 @@
});
%h2
= model.name
-
+ - if is_authorized(model.web_uri, "PUT")
+ %span{:class => "edit_button"}
+ (
+ %a{:href => url_for("/model/#{model.id}/name?mode=edit"), :id => "edit_#{model.id}"} edit
+ )
diff --git a/views/models.haml b/views/models.haml
index 9b70ae7..947e403 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;
});
@@ -18,8 +18,11 @@
= haml :similarity, :layout => false
= haml :significant_fragments, :layout => false
-- if @models
- - @models.each do |model|
- = haml :model, :locals=>{:model=>model,:subjectstring=>subjectstring}, :layout => false
--if @models.size == 0
+- first = 5*@page
+- last = first+4
+= models_navigation if @models.size > 1
+- if @models[first..last]
+ - @models[first..last].each do |model|
+ = 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/models_navigation.haml b/views/models_navigation.haml
new file mode 100644
index 0000000..0dc1f63
--- /dev/null
+++ b/views/models_navigation.haml
@@ -0,0 +1,70 @@
+.models_navigation
+
+ %form{:name => "nav", :action => url_for('/models'), :method => "get", :id => "nav"}
+ %input{:type => :hidden, :name => :sort_by, :id => "sort_by", :value => params[:sort_by]}
+ %input{:type => :hidden, :name => :order, :id => "order", :value => params[:order]}
+ %input{:type => :hidden, :name => :page, :id => "page", :value => params[:page]}
+
+ Sort by:
+ - ["created_at","name","type"].each do |s|
+ - idname = s == "created_at" ? "date" : s
+ - if params[:sort_by] == s
+ %div{:id => idname, :class => "active"}
+ %span="#{idname.capitalize}"
+ - if params[:order] == "ASC"
+ #up{:class => "link"}
+ %img{:src => "arrow_down.png", :alt => 'in ascending order', :title => 'in ascending order'}/
+ - else
+ #down{:class => "link"}
+ %img{:src => "arrow_up.png", :alt => 'in descending order', :title => 'in descending order'}/
+ - else
+ %div{:id => idname, :class => "link"}="#{idname.capitalize} "
+ - if @models.size > 5
+ |
+ Models:
+ = "#{@models.size}"
+ - unless @page.to_i == 0
+ #prev
+ %img{:src => "arrow_left.png", :alt => 'previous', :title => 'previous'}/
+ -else
+ %img{:src => "arrow_left_inactive.png", :alt => '', :title => ''}/
+
+ - if @models.size < 5*@page+5
+ - last = @models.size
+ - else
+ - last = 5*@page+5
+
+ = "(#{5*@page+1}-#{last}/#{@models.size})"
+ - unless 5*@page.to_i+5 >= @models.size
+ #next
+ %img{:src => "arrow_right.png", :alt => 'next', :title => 'next'}/
+ -else
+ %img{:src => "arrow_right_inactive.png", :alt => '', :title => ''}/
+
+ - js = ""
+ - ["created_at","name","type"].each do |s|
+ - idname = s == "created_at" ? "date" : s
+ - js += "$('##{idname}').click(function() \{ \n "
+ - js += " $('#sort_by').val('#{s}');\n "
+ - js += " $('#nav').submit();\n "
+ - js += "});\n "
+
+ :javascript
+ $("#prev").click(function() {
+ $("#page").val(#{@page-1});
+ $("#nav").submit();
+ });
+ $("#next").click(function() {
+ $("#page").val(#{@page+1});
+ $("#nav").submit();
+ });
+ #{js}
+ $("#down").click(function() {
+ $("#order").val("ASC");
+ $("#nav").submit();
+ });
+ $("#up").click(function() {
+ $("#order").val("DESC");
+ $("#nav").submit();
+ });
+ \ No newline at end of file
diff --git a/views/style.sass b/views/style.sass
index 9f1bf5b..ab05d93 100644
--- a/views/style.sass
+++ b/views/style.sass
@@ -281,3 +281,33 @@ dl
margin-left: 16px
margin-right: 16px
float: left
+
+.models_navigation
+ #prev
+ @extend a
+ display: inline
+ cursor: pointer
+ #next
+ @extend a
+ display: inline
+ cursor: pointer
+ .link
+ @extend a
+ display: inline
+ cursor: pointer
+ .active
+ display: inline
+ color: #000
+ font-weight: bold
+ .thin
+ font-weight: 100
+
+.level_1
+ padding-left: 10px
+ font-weight: bold
+.level_2
+ padding-left: 20px
+.level_3
+ padding-left: 30px
+.level_4
+ padding-left: 40px
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