Merge branch '15028-cwl-v1.1' refs #15028
[arvados.git] / apps / workbench / app / views / application / _content.html.erb
index 99fbfaa2fd2087516266aa023c2939754b297f41..c4656e659d51cd08b2d75f8ad1859ad5aa7e1ba7 100644 (file)
@@ -1,3 +1,7 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <% content_for :tab_panes do %>
 
   <% comparable = controller.respond_to? :compare %>
@@ -6,6 +10,7 @@
     <% pane_list.each_with_index do |pane, i| %>
       <% pane_name = (pane.is_a?(Hash) ? pane[:name] : pane) %>
 
+      <% data_toggle = "tab" %>
       <% tab_tooltip = "" %>
       <% link_disabled = "" %>
 
             if @object.log and !@object.log.empty?
               logCollection = Collection.find? @object.log
               if !logCollection
+                data_toggle = "disabled"
                 tab_tooltip = "Log data is not available"
                 link_disabled = "disabled"
               end
             end
-          elsif controller.model_class.to_s == 'PipelineInstance'
-            log_uuids = [@object.uuid] + pipeline_jobs(@object).collect{|x|x[:job].andand[:uuid]}.compact
-            if stderr_log_history(log_uuids, 1).empty?
-              tab_tooltip = "Log data is not available"
-              link_disabled = "disabled"
-            end
+          elsif (controller.model_class.to_s == 'PipelineInstance' and
+                 !@object.has_readable_logs?)
+            data_toggle = "disabled"
+            tab_tooltip = "Log data is not available"
+            link_disabled = "disabled"
           end
         end
       %>
 
-      <li class="<%= 'active' if i==0 %> <%= link_disabled %>" data-toggle="tooltip" data-placement="top" title="<%=tab_tooltip%>">
+      <li class="<%= 'active' if i==0 %> <%= link_disabled %> tab-pane-<%=pane_name%>" data-toggle="tooltip" data-placement="top" title="<%=tab_tooltip%>">
         <a href="#<%= pane_name %>"
            id="<%= pane_name %>-tab"
-           data-toggle="tab"
+           data-toggle="<%= data_toggle %>"
            data-tab-history=true
            data-tab-history-update-url=true
            >
@@ -51,7 +56,7 @@
            <% else %>
              data-object-uuid="<%= @object.uuid %>"
            <% end %>
-           data-pane-content-url="<%= url_for(params.merge(tab_pane: pane_name)) %>"
+           data-pane-content-url="<%= url_for(params.permit!.merge(tab_pane: pane_name)) %>"
            style="margin-top:0.5em;"
            >
         <div class="pane-content">