-<% content_for :js do %>
- $(document).on('<%= 'ready' if i != 0 %> arv-log-event', function() {
- $.ajax('<%= url_for @object %>?tab_pane=<%= pane %>', {dataType: 'html', type: 'GET'}).
- done(function(data, status, jqxhr) {
- $('#<%= pane %> > div > div').html(data);
- }).
- fail(function(jqxhr, status, error) {
- });
- });
-<% end %>
+ <% data_toggle = "tab" %>
+ <% tab_tooltip = "" %>
+ <% link_disabled = "" %>
+
+ <% if (pane_name == "Log") and !(ArvadosBase.find(@object.owner_uuid).writable_by.include?(current_user.andand.uuid) rescue nil)
+ if controller.model_class.to_s == 'Job'
+ 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' 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 %> tab-pane-<%=pane_name%>" data-toggle="tooltip" data-placement="top" title="<%=tab_tooltip%>">
+ <a href="#<%= pane_name %>"
+ id="<%= pane_name %>-tab"
+ data-toggle="<%= data_toggle %>"
+ data-tab-history=true
+ data-tab-history-update-url=true
+ >
+ <%= pane_name.gsub('_', ' ') %> <span id="<%= pane_name %>-count"></span>
+ </a>
+ </li>
+ <% end %>
+ </ul>