summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-06-16 23:43:00 +0200
committermguetlein <martin.guetlein@gmail.com>2011-06-16 23:43:00 +0200
commitdc36db9026a74fa2c90979b0b4aa9b96ad105234 (patch)
tree1fb49f909c3dfda283994dc96670cbcdeef9015b
parentdb2abd5ff62d881b3fecd7a2012bd54c55c6c42c (diff)
add some description to task html
-rw-r--r--application.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/application.rb b/application.rb
index 2967d95..5ec56dc 100644
--- a/application.rb
+++ b/application.rb
@@ -100,9 +100,18 @@ get '/:id/?' do
when /html/
response['Content-Type'] = 'text/html'
metadata = task.metadata
+ description = task.title ? "This task computes '"+task.title+"'" : "This task performs a process that is running on the server."
+ if task.hasStatus=="Running"
+ description << "\nRefresh your browser (presss F5) to see if the task has finished."
+ elsif task.hasStatus=="Completed"
+ description << "\nThe task is completed, click on the link below to see your result."
+ elsif task.errorReport
+ description << "\nUnfortunately, the task has failed."
+ end
+ related_links = task.hasStatus=="Completed" ? "The task result: "+task.resultURI : nil
metadata[OT.waitingFor] = task.waiting_for
metadata[OT.errorReport] = task.errorReport if task.errorReport
- halt code, OpenTox.text_to_html(metadata.to_yaml)
+ halt code, OpenTox.text_to_html(metadata.to_yaml, @subjectid, related_links, description)
when /application\/rdf\+xml|\*\/\*/ # matches 'application/x-yaml', '*/*'
response['Content-Type'] = 'application/rdf+xml'
t = OpenTox::Task.new task.uri