<%!
# retrieve settings
isLite = (cherrypy.config['product_type'] == 'lite' or cherrypy.config['product_type'] == 'lite_free')

if cherrypy.config['product_type'] == 'hunk':
    faviconFile = 'favicon_hunk.ico'
elif isLite:
    faviconFile = 'favicon_lite.ico'
else:
    faviconFile = 'favicon.ico'

faviconFilePath = '/static/img/' + faviconFile

config_qs = dict(autoload=1)
if hasattr(cherrypy.request, 'embed') and cherrypy.request.embed:
    config_qs['embed'] = 1
%>\

<%
app_name = app

splk_root = "/static"
app_root = "/".join([splk_root,"app",app_name])

app_js_build = app_root + '/js/build'
app_css_build = app_root + '/css'

# optimized js and css
bootstrap_css = "%s/bootstrap-enterprise.css" % app_css_build

if isLite:
    bootstrap_css = "%s/bootstrap-lite.css" % app_css_build

entry_js = "%s/%s.js" % (app_js_build ,'entry_page')
%>\

<!doctype html>
<!--[if lt IE 7]> <html lang="${i18n.current_lang()[0]|h}" class="no-js ie  lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html lang="${i18n.current_lang()[0]|h}" class="no-js ie7 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html lang="${i18n.current_lang()[0]|h}" class="no-js ie8 lt-ie9"> <![endif]-->
<!--[if IE 9]>    <html lang="${i18n.current_lang()[0]|h}" class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!-->
<html lang="${i18n.current_lang()[0]|h}" class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>${_('Loading...')}</title>
        <meta name="description" content="listen to your data" />
        <meta name="author" content="Splunk Inc." />
        <meta name="viewport" content="width=1024, initial-scale=1.0" />
        <link rel="shortcut icon" href="${make_url(faviconFilePath)}" />
        <link rel="apple-touch-icon-precomposed" sizes="57x57" href="${make_url('/static/img/bookmark/apple-icon-57x57-precomposed.png')}" />
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="${make_url('/static/img/bookmark/apple-icon-72x72-precomposed.png')}" />
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="${make_url('/static/img/bookmark/apple-icon-114x114-precomposed.png')}" />
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="${make_url('/static/img/bookmark/apple-icon-144x144-precomposed.png')}" />
        <meta name="msapplication-TileColor" content="#65A637">
        <meta name="msapplication-TileImage" content="${make_url('/static/img/bookmark/ms-tileicon-144x144.png')}">

        <link rel="stylesheet" type="text/css" media="all" href="${make_url(bootstrap_css)}" />
        <script src="${make_url('/static/js/i18n.js')}"></script>
    </head>
    <body s:app="${app_name}">
        <div class="preload">
        </div>
        <div class="dialog-placeholder"></div>
        <!--load require js for dynamic component loading-->
        <script src="${make_url('/static/js/contrib/require.js')}"></script>
        <script src="${make_url('/static/js/profiles/shared.js')}"></script>
        <script type="text/javascript">
            require.config({
                baseUrl: "${make_url('/static/js')}",
                paths: {
                    "custom": "../app/${app_name}/js/build/custom"
                },
                waitSeconds : 0
            });
        </script>

        <script src="${make_url('/config', _qs=config_qs)}"></script>
        <script src="${make_url('/i18ncatalog?autoload=1')}"></script>
        <script>
            __splunkd_partials__ = ${json_decode(splunkd)};
        </script>
        <script src="${make_url(app_js_build + '/common.js')}"></script>
        <script src="${make_url(entry_js)}"></script>
    </body>
</html>
