From dc36db9026a74fa2c90979b0b4aa9b96ad105234 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 16 Jun 2011 23:43:00 +0200 Subject: add some description to task html --- application.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3