%# Copyright (C) The Arvados Authors. All rights reserved.
SPDX-License-Identifier: AGPL-3.0 %>
<% if content_for? :page_title %>
<%= yield :page_title %> / <%= Rails.configuration.Workbench.SiteName %>
<% else %>
<%= Rails.configuration.Workbench.SiteName %>
<% end %>
<% if current_user %>
<% content_for :js do %>
window.defaultSession = <%=raw({baseURL: Rails.configuration.Services.Controller.ExternalURL.to_s.gsub(/\/?$/,'/'), token: Thread.current[:arvados_api_token], user: current_user}.to_json)%>
<% end %>
<% end %>
<% if current_user and $arvados_api_client.discovery[:websocketUrl] %>
<% end %>
<%# Feature #5645: Add open graph meta tags to generate this page's
social graph that search engines can use. http://ogp.me/ %>
<% if defined?(@object) && @object %>
<% if @object.respond_to?(:name) and @object.name.present? %>
<% end %>
<% if (@object.respond_to?(:description) rescue nil) and @object.description.present? %>
<% end %>
<% end %>
<%# Done adding open graph meta tags %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= yield :head %>
<%= javascript_tag do %>
angular.module('Arvados').value('arvadosApiToken', '<%=Thread.current[:arvados_api_token]%>');
angular.module('Arvados').value('arvadosDiscoveryUri', '<%= Rails.configuration.Services.Controller.ExternalURL.to_s + '/discovery/v1/apis/arvados/v1/rest' %>');
<%= yield :js %>
<% end %>
<%= piwik_tracking_tag if (PiwikAnalytics.configuration.url != 'localhost' rescue false) %>
<%= render template: 'layouts/body' %>
<%= javascript_tag do %>
<%= yield :footer_js %>
<% end %>