Merge branch 'master' into 4232-slow-pipes-n-jobs
[arvados.git] / apps / workbench / app / views / pipeline_instances / _running_component.html.erb
index caa8377ad03a4d2e11c2662b4b16aef1bfee7391..4359860c6e5529c487dd8b4a672e9058e31e1cef 100644 (file)
@@ -4,9 +4,9 @@
     <div class="container-fluid">
       <div class="row-fluid">
         <%# column offset 0 %>
-        <div class="col-md-3">
+        <div class="col-md-3" style="word-break:break-all;">
           <h4 class="panel-title">
-            <a data-toggle="collapse" href="#collapse<%= i %>" style="white-space: nowrap;">
+            <a data-toggle="collapse" href="#collapse<%= i %>">
               <%= pj[:name] %> <span class="caret"></span>
             </a>
           </h4>
           <% if current_job[:state] == "Queued" %>
             <%# column offset 5 %>
             <div class="col-md-6">
-              <% queuetime = Time.now - current_job[:created_at] %>
+              <% queuetime = Time.now - Time.iso8601(current_job[:created_at]) %>
               Queued for <%= render_runtime(queuetime, true) %>.
               <% begin %>
                 <% if current_job[:queue_position] == 0 %>
                   This job is next in the queue to run.
                 <% elsif current_job[:queue_position] == 1 %>
                   There is 1 job in the queue ahead of this one.
-                <% else %>
+                <% elsif current_job[:queue_position] %>
                   There are <%= current_job[:queue_position] %> jobs in the queue ahead of this one.
                 <% end %>
               <% rescue %>
             </div>
           <% end %>
 
-          <% if current_job[:state].in? ["Queued", "Running"] %>
+          <% if current_job[:state].in? ["Queued", "Running"] and @object.editable? %>
             <%# column offset 11 %>
             <div class="col-md-1 pipeline-instance-spacing">
-              <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
+              <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %>
                 <%= hidden_field_tag :return_to, url_for(@object) %>
                 <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-job-button"} %>
               <% end %>