{{define "head"}}
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="robots" content="noindex, nofollow">

    <title>{{ .Props.Title }}</title>

    <!-- iOS add to homescreen -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-title" content="{{ .Props.Title }}">
    <meta name="application-name" content="{{ .Props.Title }}">
    <meta name="format-detection" content="telephone=no">
    <!-- iOS add to homescreen -->

    <!-- Android add to homescreen -->
    <link rel="manifest" href="/static/config/manifest.json">
    <!-- Android add to homescreen -->

    <script>
        window.config = {{ .ClientProps }};
    </script>

    <!-- CSS Should always go first -->
    <link rel="stylesheet" href="/static/css/bootstrap-3.3.5.min.css">
    <link rel="stylesheet" href="/static/css/jasny-bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="/static/css/styles.css">
    <link rel="stylesheet" href="/static/css/google-fonts.css">

    <link id="favicon" rel="icon" href="/static/images/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon">

    <script src="/static/js/react-0.14.0.js"></script>
    <script src="/static/js/react-dom-0.14.0.js"></script>
    <script src="/static/js/jquery-2.1.4.js"></script>
    <script src="/static/js/bootstrap-3.3.5.js"></script>
    <script src="/static/js/bootstrap-colorpicker.min.js"></script>
    <script src="/static/js/react-bootstrap-0.27.1.js"></script>
    <script src="/static/js/perfect-scrollbar-0.6.7.jquery.min.js"></script>
    <script src="/static/js/jquery-dragster/jquery.dragster.js"></script>

    <style id="antiClickjack">body{display:none !important;}</style>

    <script>
        window.onerror = function(msg, url, line, column, stack) {
            var l = {};
            l.level = 'ERROR';
            l.message = 'msg: ' + msg + ' row: ' + line + ' col: ' + column + ' stack: ' + stack + ' url: ' + url;

            $.ajax({
                url: '/api/v1/admin/log_client',
                dataType: 'json',
                contentType: 'application/json',
                type: 'POST',
                data: JSON.stringify(l)
            });
        }
    </script>

    <script src="/static/js/libs.min.js"></script>
    <script src="/static/js/bundle.js"></script>

    <script type="text/javascript">
        if (self === top) {
            var blocker = document.getElementById("antiClickjack");
            blocker.parentNode.removeChild(blocker);
        }
    </script>

    <script type="text/javascript">
        if (window.config.SegmentDeveloperKey != null && window.config.SegmentDeveloperKey !== "") {
            !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
            analytics.load(window.config.SegmentDeveloperKey);
            var user = window.UserStore.getCurrentUser(true);
            if (user) {
              analytics.identify(user.id, {
                  name: user.nickname,
                  email: user.email,
                  createdAt: user.create_at,
                  username: user.username,
                  team_id: user.team_id,
                  id: user.id
              });
            }
            analytics.page();
            }}();
        } else {
            analytics = {};
            analytics.page = function(){};
            analytics.track = function(){};
        }
    </script>
</head>
{{end}}
