7753: The name "Job log" has a little problem; on screen small screen sizes, "Job...
[arvados.git] / apps / workbench / app / helpers / pipeline_instances_helper.rb
index 939ddcb43ef062c8e9a5b5accd54855b0daaa52d..8fafbc2022d5873032d1f9565c2385a26f4a794b 100644 (file)
@@ -289,7 +289,7 @@ module PipelineInstancesHelper
     else
       s = ""
       if days > 0
-        s += "#{days}<span class='time-label-divider'>d</span> "
+        s += "#{days}<span class='time-label-divider'>d</span>"
       end
 
       if (hours > 0)
@@ -298,7 +298,7 @@ module PipelineInstancesHelper
 
       s += "#{minutes}<span class='time-label-divider'>m</span>"
 
-      if not round_to_min
+      if not round_to_min or (days == 0 and hours == 0 and minutes == 0)
         s += "#{seconds}<span class='time-label-divider'>s</span>"
       end
     end
@@ -306,19 +306,6 @@ module PipelineInstancesHelper
     raw(s)
   end
 
-  def render_runtime_compact duration
-    if duration >= DAY
-      "#{(duration / DAY.to_f).round(2)} days"
-    elsif duration >= HOUR
-      "#{(duration / HOUR.to_f).round(2)} hours"
-    elsif duration >= MINUTE
-      "#{(duration / MINUTE.to_f).round(2)} minutes"
-    else
-      seconds = duration.round(2)
-      "#{seconds} second#{'s' if seconds != 1}"
-    end
-  end
-
   def render_unreadable_inputs_present
     if current_user and controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present?
       raw('<div class="alert alert-danger unreadable-inputs-present">' +