Bugfix extra space in display in render_runtime and queued time for pipeline.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 23 Sep 2014 18:35:54 +0000 (14:35 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 23 Sep 2014 18:35:54 +0000 (14:35 -0400)
refs #3187

apps/workbench/app/helpers/pipeline_instances_helper.rb
apps/workbench/app/views/pipeline_instances/_running_component.html.erb
apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb

index f0c4eb72880cd0427aa528be76c8a227fff046f3..599da421cfc91d5c42d9e015fd67b3829f77292e 100644 (file)
@@ -246,19 +246,20 @@ module PipelineInstancesHelper
     end    
 
     if use_words
-      s = ""
+      s = []
       if days > 0 then
-        s += "#{days} day#{'s' if days != 1}"
+        s << "#{days} day#{'s' if days != 1}"
       end
       if hours > 0 then
-        s += " #{hours} hour#{'s' if hours != 1}"
+        s << "#{hours} hour#{'s' if hours != 1}"
       end
       if minutes > 0 then
-        s += " #{minutes} minute#{'s' if minutes != 1}"
+        s << "#{minutes} minute#{'s' if minutes != 1}"
       end
       if seconds > 0 and not round_to_min 
-        s += " #{seconds} second#{'s' if seconds != 1}"
+        s << "#{seconds} second#{'s' if seconds != 1}"
       end
+      s = s * " "
     else
       s = ""
       if days > 0
index 5eed855d8d85806b98b5fc5c86d0968f4b9544f1..8f89916fba84ab64d859ff4423211c517c157b7d 100644 (file)
@@ -1,4 +1,4 @@
-  <% current_job = pj[:job] if pj[:job] != {} %>
+  <% current_job = pj[:job] if pj[:job] != {} and pj[:job][:uuid] %>
   <div class="panel panel-default">
     <div class="panel-heading">
       <div class="container-fluid">
index c3c6d0a2a3c64d81d3e50fb6404b945b732ab56f..8af8c881d88f0d9b0e8b6990d042db6ba1851565 100644 (file)
@@ -58,8 +58,8 @@
          0
        end
        }.reduce(:+) || 0 %>
-    <%= render_runtime(runningtime, true, false) %><% if walltime - runningtime > 0 %>
-      (<%= render_runtime(walltime - runningtime, true) %> queued)<% end %><% if cputime == 0 %>.<% else %>
+    <%= render_runtime(runningtime, true, false) %><% if (walltime - runningtime) > 0 %>
+      (<%= render_runtime(walltime - runningtime, true, false) %> queued)<% end %><% if cputime == 0 %>.<% else %>
       and used
     <%= render_runtime(cputime, true) %>
     of CPU time (<%= (cputime/runningtime).round(1) %>&Cross; scaling).