{% load staticfiles i18n %}

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <!--<link rel="shortcut icon" href="../../assets/ico/favicon.png">-->

        <title>{% block title %}Advanced Report{% endblock %}</title>

        <!-- Bootstrap core CSS -->
        <link href="{{ STATIC_URL }}advanced_reports/css/core.css" rel="stylesheet" />
        <style type="text/css">
            body {
                padding-top: 82px;
            }

            .ui-datepicker-trigger {
                position: absolute;
                right: 9px;
                top: 9px;
            }

            .form-group {
                position: relative;
            }

            .row {
                margin-bottom: 0;
            }
        </style>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
            <script src="{{ STATIC_URL }}advanced_reports/js/html5shiv.js"></script>
            <script src="{{ STATIC_URL }}advanced_reports/js/respond.min.js"></script>
        <![endif]-->

        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular-cookies.js"></script>

        {% block extra-head %}{% endblock %}
        <script type="text/javascript">
            var STATIC_URL = JS_STATIC_URL;
        </script>
    </head>

    <body>

        <div id="notification"></div>

        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">{% block head-title %}Advanced Report{% endblock %}</a>
                </div>

                {% if request.user.is_authenticated %}
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        {% block navbar %}
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Operations <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li><a href="#">Separated link</a></li>
                                <li><a href="#">One more separated link</a></li>
                            </ul>
                        </li>
                        {% endblock %}
                    </ul>
                    <div class="navbar-text navbar-right">
                        {% blocktrans with request.user.first_name as first_name %}Hi, <strong>{{ first_name }}</strong>{% endblocktrans %}
                    </div>
                </div><!--/.navbar-collapse -->
                {% endif %}
            </div><!-- /.container -->
        </div>

        {% block content-override %}
        <div class="page">
            {% block header-title-wrapper %}{% endblock %}
            <section class="content" role="main">
                {% block content %}
                <div class="container">
                    {% block content-inner %}{% endblock %}
                </div>
                {% endblock %}
            </section>
        </div>
        {% endblock %}

        <footer>
            <div class="container">
                {% with '<a href="https://github.com/vikingco/django-advanced-reports">Advanced Reports</a>' as advreports_github_url %}
                    {% blocktrans %}Proudly powered by {{ advreports_github_url }}{% endblocktrans %}
                {% endwith %}
            </div>
        </footer>

        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="{{ STATIC_URL }}advanced_reports/js/bootstrap.js"></script>
        <script src="{{ STATIC_URL }}advanced_reports/js/core.js"></script>
        <script src="{{ STATIC_URL }}advanced_reports/js/modules/notification.js"></script>
        <script src="{{ STATIC_URL }}admin/js/admin/RelatedObjectLookups.js"></script>

        <script>
            frontend.notification.init();
        </script>

        {% if messages %}
        <script>
            $(function(){
                {% for msg in messages %}
                    {% if forloop.last %}
                var params = {
                    message: "{{ msg|safe }}",
                    type: "{{ msg.tags }}",
                    isAutoHide: {% if msg.tags == 'error' or msg.tags == 'warning' %}false{% else %}true{% endif %}
                };
                    {% endif %}
                {% endfor %}

                frontend.notification.show(params);
            });
        </script>
        {% endif %}
    </body>
</html>
