<!DOCTYPE html>
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]-->
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link rel="shortcut icon" type="image/x-icon" href="<%= image_path('favicon.ico') -%>">
  <%
     if @page_title
       title="SonarQube - #{h(@page_title)}"
     elsif @project
       title="SonarQube - #{h(@project.name)}"
     elsif @resource
       title="#{h(@resource.long_name)}"
     else
       title='SonarQube'
     end
  %>
  <title><%= title -%></title>

  <link href="<%= ApplicationController.root_context -%>/css/sonar.css?v=<%= sonar_version -%>" rel="stylesheet" media="all">
  <%= yield :style -%>

  <script>
    var pageLang = '<%= I18n.locale.to_s.gsub(/-/, '_') -%>';
    <%# The two lines below mean that before full removal of Rails, we have to find a way to handle config properties %>
    window.SS = typeof window.SS === 'object' ? window.SS : {};
    window.SS.hoursInDay = <%= configuration('sonar.technicalDebt.hoursInDay', 8) %>;
    window.SS.user = '<%= current_user.login if current_user -%>';
    window.SS.userName = '<%= current_user.name if current_user -%>';
  </script>
  <script src="<%= ApplicationController.root_context -%>/js/sonar.js?v=<%= sonar_version -%>"></script>
  <script>
    var baseUrl = '<%= ApplicationController.root_context -%>';
    var $j = jQuery.noConflict();
    $j(document).ready(function () {$j('.open-modal').modal()});
    moment.lang(window.pageLang);
    numeral.language(window.pageLang);
  </script>
  <script src="<%= ApplicationController.root_context -%>/js/require.js?v=<%= sonar_version -%>"></script>
  <script>
    requirejs.config({
      baseUrl: baseUrl + '/js',
      urlArgs: 'v=<%= sonar_version -%>'
    });
  </script>
  <%= yield :script -%>
</head>
<body>
