{% load i18n %}
{% load sentry_helpers %}
{% load static_compiler %}
{% get_sentry_version %}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="robots" content="NONE,NOARCHIVE">

        <link href="{% url 'sentry-media' "sentry" "images/favicon.ico" %}" rel="shortcut icon" type="image/png"/>

        {% block css %}
            {% staticbundle 'sentry/styles/global.min.css' %}
        {% endblock %}

        <title>{% block title %}Sentry{% endblock %}</title>

        <!--[if lt IE 9]>
        <script type="text/javascript" src="{% url 'sentry-media' "sentry" "scripts/lib/html5shiv.js" %}"></script>
        <![endif]-->
        {% block scripts %}
            {% staticbundle 'sentry/scripts/lib.min.js' %}
            {% staticbundle 'sentry/scripts/bootstrap.min.js' %}
            {% staticbundle 'sentry/scripts/global.min.js' %}
            {% staticbundle 'sentry/scripts/legacy.min.js' %}
            <script type="text/javascript">
            {% if request.LANGUAGE_CODE %}
                moment.lang('{{ request.LANGUAGE_CODE }}');
            {% endif %}
            app.config.popupCss = '{% url 'sentry-media' "sentry" 'styles/popup.css' %}';
            app.config.mediaUrl = '{% url 'sentry-media' "sentry" '' %}';
            app.config.urlPrefix = {{ URL_PREFIX|to_json|safe }};
            {% if project %}
                app.config.projectId = {{ project.slug|to_json|safe }};
                app.config.teamId = {{ project.team.slug|to_json|safe }};
            {% elif team %}
                app.config.projectId = null;
                app.config.teamId = {{ team.slug|to_json|safe }};
            {% else %}
                app.config.projectId = null;
                app.config.teamId = null;
            {% endif %}
            </script>
        {% endblock %}

        {% block meta %}
        {% endblock %}
    </head>

    <body class="{% block wrapperclass %}{% endblock %}">
        <div class="outer-wrapper">
        {% block body %}
        {% block header %}
            <header id="header">
                <div class="navbar navbar-inverse">
                    <div class="navbar-inner">
                        <div class="container">
                            <a id="logo" href="{% url 'sentry' %}">Sentry</a>
                            {% if team %}
                            <div id="team-banner">
                                {% if TEAM_LIST %}
                                    <a class="dropdown-toggle" data-toggle="dropdown">
                                        {{ team.name }}
                                        {% if project %}
                                            <small>{{ project.name }}</small>
                                        {% endif %}
                                        <span class="caret"></span>
                                    </a>
                                    <nav class="dropdown-menu">
                                        <!-- <input type="text" value="search by project name"> <a href="#" class="btn">New</a> -->
                                        {% for t, p_list in TEAM_LIST|reorder_teams:team %}
                                            <h6><a href="{% url 'sentry' t.slug %}">{{ t.name }}</a></h6>
                                            <ul class="project-list">
                                                {% for p in p_list %}
                                                    <li{% if p.id == project.id %} class="active"{% endif %}>
                                                        <a href="{% url 'sentry-stream' t.slug p.slug %}" title="{{ p.name }}">{{ p.name }}</a>
                                                    </li>
                                                {% endfor %}
                                            </ul>
                                        {% endfor %}
                                    </nav>
                                {% else %}
                                    <a>
                                        {{ team.name }}
                                        {% if project %}
                                            <small>{{ project.name }}</small>
                                        {% endif %}
                                    </a>
                                {% endif %}
                            </div>
                            {% else %}
                                <h1>{% block heading %}{% endblock %}</h1>
                            {% endif %}
                            <ul class="nav pull-right">
                                {% block account_nav %}
                                    {% if request.user.is_authenticated %}
                                        {% if team and request.user|can_admin_team:team %}
                                            <li><a href="{% url 'sentry-manage-team' team.slug %}">Team Settings</a></li>
                                        {% endif %}
                                        <li class="dropdown">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img class="avatar" src="{% gravatar_url user.email size 20 %}"> <span class="caret"></span></a>
                                            <ul class="dropdown-menu">
                                                <li><a href="{% url 'sentry-account-settings' %}">{% trans "Account" %}</a></li>
                                                <li><a href="{% url 'sentry' %}">{% trans "Teams" %}</a></li>
                                                {% if request.user.is_staff %}
                                                    <li><a href="{% url 'sentry-admin-status' %}">{% trans "Admin" %}</a></li>
                                                {% endif %}
                                                <li class="divider">
                                                <li><a href="{% url 'sentry-logout' %}">{% trans "Logout" %}</a></li>
                                            </ul>
                                        </li>
                                    {% else %}
                                        <li><a href="{% url 'sentry-login' %}">{% trans "Login" %}</a></li>
                                    {% endif %}
                                {% endblock %}
                            </ul>
                         </div>
                    </div>
                </div>
            </header>
        <section id="page-header" class="toolbar">
            <div class="container">
                <div class="dashboard-btn">
                    <a href="{% url 'sentry' team.slug %}" title="{% trans "Dashboard" %}">
                        <i aria-hidden="true" class="icon-list"></i>
                    </a>
                </div>
            </div>
        </section>
        <section id="content">
            <div class="container">
                <div class="content">
                    <div class="main">
                        {% include "sentry/partial/alerts.html" %}

                        {{outlet}}
                    </div>
                </div>
            </div>
        </section>
        <footer>
            <div class="container">
                <div class="contribute">Sentry is <a href="http://en.wikipedia.org/wiki/Open-source_software">Open Source Software</a>
                    <a href="https://github.com/getsentry/sentry" class="btn btn-small">{% trans "Contribute" %}</a> <a href="https://www.transifex.com/projects/p/sentry/" class="btn btn-small">{% trans "Translate" %}</a></div>
                <div class="version">Sentry {{ sentry_version.current }} {% if sentry_version.update_available %}<a href="#" title="You're running a year old version of Sentry, did you know {{ sentry_version.latest }} is available?" class="tip icon-circle-arrow-up">&nbsp;</a>{% endif %}</div>
                <div class="credits">Handcrafted by the <a href="https://www.getsentry.com">Sentry team</a> and its <a href="https://github.com/getsentry/sentry/contributors">many contributors</a></div>
            </div>
        </footer>
    </body>
</html>
