From b40e9a00a1a779b11da4d5ab5078c76207a3456a Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 9 Feb 2011 09:50:18 +0100 Subject: refining thhe progressbar --- public/javascripts/toxcreate.js | 4 +++- .../progressbar/images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 225 -> 2062 bytes .../images/ui-bg_highlight-hard_15_888888_1x100.png | Bin 150 -> 214 bytes views/model.haml | 12 +++++------- views/style.sass | 13 +++++++++---- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/public/javascripts/toxcreate.js b/public/javascripts/toxcreate.js index 949b9ea..de5e73d 100755 --- a/public/javascripts/toxcreate.js +++ b/public/javascripts/toxcreate.js @@ -75,7 +75,9 @@ $(function() { var progress = data.trim(); if (progress == "100") return -1; - $("div#model_" + id + "_progress").progressbar("value", parseInt(progress)); + $("div#model_" + id + "_progress").progressbar("value", parseInt(progress)); + $("div#model_" + id + "_progress").attr({title: parseInt(progress) + "%", alt: parseInt(progress) + "%"}); + //$("div#model_" + id + "_progress").attr("alt", parseInt(progress) + "%"); }, error: function(data) { id = -1; diff --git a/public/progressbar/images/ui-bg_flat_0_aaaaaa_40x100.png b/public/progressbar/images/ui-bg_flat_0_aaaaaa_40x100.png index e3dcd29..f4b49ad 100644 Binary files a/public/progressbar/images/ui-bg_flat_0_aaaaaa_40x100.png and b/public/progressbar/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/public/progressbar/images/ui-bg_highlight-hard_15_888888_1x100.png b/public/progressbar/images/ui-bg_highlight-hard_15_888888_1x100.png index da27188..7a61a4d 100644 Binary files a/public/progressbar/images/ui-bg_highlight-hard_15_888888_1x100.png and b/public/progressbar/images/ui-bg_highlight-hard_15_888888_1x100.png differ diff --git a/views/model.haml b/views/model.haml index 52d143c..d218fea 100644 --- a/views/model.haml +++ b/views/model.haml @@ -16,23 +16,21 @@ = haml :model_status, :locals=>{:model=>model}, :layout => false - if model.task_uri && model.status != "Completed" - if (task = OpenTox::Task.exist?(model.task_uri)) - - percentage_completed = task.metadata[OT.percentageCompleted] + - 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"} + %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'} + %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'} - if model.status == "Completed" - delete + (delete) - else - stop - ) + (stop) %dt Started: %dd= model.created_at.strftime("%m/%d/%Y - %I:%M:%S%p") diff --git a/views/style.sass b/views/style.sass index a2b8191..db1f1bf 100644 --- a/views/style.sass +++ b/views/style.sass @@ -250,8 +250,13 @@ dl .edit_button font-size: 0.5em - + +.model_status + float: left + .model_progress - width: 240px - height: 20px - float: right \ No newline at end of file + width: 200px + height: 16px + margin-left: 16px + margin-right: 16px + float: left -- cgit v1.2.3