summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-03-27 17:11:59 +0100
committergebele <gebele@in-silico.ch>2013-03-27 17:11:59 +0100
commitde03020a09cdc6438d27916207cab1de554a70f2 (patch)
tree65192a060f7793d7741cb1c5f5d91f124ba9e0b6 /views
parent2b02d8fdafe4ea4d4027d5aa18d56fc77ec5ef9a (diff)
error handling compound names;smiles validation
Diffstat (limited to 'views')
-rw-r--r--views/details.haml6
-rw-r--r--views/error.haml8
-rw-r--r--views/predict.haml5
3 files changed, 14 insertions, 5 deletions
diff --git a/views/details.haml b/views/details.haml
index 448e8a8..38d97fe 100644
--- a/views/details.haml
+++ b/views/details.haml
@@ -7,12 +7,12 @@
%img{:src=>"#{@compound_uri.uri}/image", :alt=>@compound_uri.uri, :width=>"100px"}
%p
SMILES:
- = @compound_uri.smiles if @compound_uri.smiles
+ = @smiles
%p
// TODO handle OpenTox::ResourceNotFoundError
Names:
- = @compound_uri.names if @compound_uri.names
+ = @names
%p
- = @compound_uri.inchi.gsub("InChI=", "InChI: ") if @compound_uri.inchi
+ = @inchi
diff --git a/views/error.haml b/views/error.haml
new file mode 100644
index 0000000..9aced43
--- /dev/null
+++ b/views/error.haml
@@ -0,0 +1,8 @@
+.error
+ .back
+ %h1
+ %img{:src=>"/images/arrow_left_float.png", :alt=>"arrow"}
+ %a{:href => to('/predict')} New Prediction
+ %error
+ = @error_report.to_s
+
diff --git a/views/predict.haml b/views/predict.haml
index dbfab50..b53acb6 100644
--- a/views/predict.haml
+++ b/views/predict.haml
@@ -6,7 +6,7 @@
};
function checksmiles () {
if (document.form.identifier.value == "") {
- alert("Please insert a compound.")
+ alert("Please insert a compound.");
document.form.identifier.focus();
return false;
};
@@ -20,7 +20,8 @@
};
return true;
};
-
+
+/ whole site content needs to be in one form. Input and checkboxes are checked by js functions.
%form{:name => "form", :action => to('/predict'), :method => "post", :enctype => "multipart/form-data", :onsubmit => "return !!(checksmiles() & checkboxes())" }
%fieldset#top
%a{:href => "#insert", :id => "linkInsert"}