<!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 = {
      hoursInDay: <%= configuration('sonar.technicalDebt.hoursInDay', 8) %>,
      user: '<%= current_user.login if current_user -%>',
      userName: '<%= current_user.name if current_user -%>',
      userEmail: '<%= current_user.email if current_user -%>',
      lf: {
        enableGravatar: <%= configuration('sonar.lf.enableGravatar', true) %>,
        gravatarServerUrl: '<%= configuration('sonar.lf.gravatarServerUrl') %>'
      },
      updateCenterActive: <%= configuration('sonar.updatecenter.activate', true) %>
    };
  </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);
    requirejs.config({
      baseUrl: baseUrl + '/js',
      urlArgs: 'v=<%= sonar_version -%>',
      paths: {
        'react': 'libs/third-party/react-with-addons',
        'underscore': 'libs/third-party/shim/underscore-shim',
        'jquery': 'libs/third-party/shim/jquery-shim',
        'backbone': 'libs/third-party/shim/backbone-shim',
        'backbone.marionette': 'libs/third-party/shim/marionette-shim',
        'moment': 'libs/third-party/shim/moment-shim'
      }
    });
  </script>
  <%= yield :script -%>
</head>
<body>
