{% extends "sentry/layout.html" %}

{% load i18n %}

{% block title %}{% trans "Dashboard" %} | {{ block.super }}{% endblock %}

{% block page_header_block %}
    <section id="page-header" class="toolbar" style="height:5px;">
    </section>
{% endblock %}

{% block bodyclass %}{% endblock %}

{% block content %}
    <div class="main">
        {% block alerts %}
            {% include "sentry/partial/alerts.html" %}
        {% endblock %}
        {% block main %}
            <section class="body dashboard">
                {% if project_list %}
                    <div id="chart" class="chart" data-api-url="{% url 'sentry-api-0-team-stats' team.id %}">
                        <div class="sparkline">
                            <noscript>{% trans "Get yourself some JavaScripts dood" %}</noscript>
                            <span class="loading">{% trans "Loading historical data..." %}</span>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="page-header clearfix">
                                <h3 class="pull-left">{% trans "Trends" %}</h3>
                                <ul class="nav nav-pills nav-small pull-right">
                                    <li><a href="#top_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-trends' organization.slug team.slug %}?minutes=15&amp;limit=5">{% trans "15 minutes" %}</a></li>
                                    <li><a href="#top_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-trends' organization.slug team.slug %}?minutes=60&amp;limit=5">{% trans "60 minutes" %}</a></li>
                                    <li class="active"><a href="#top_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-trends' organization.slug team.slug %}?minutes=1440&amp;limit=5">{% trans "24 hours" %}</a></li>
                                </ul>
                            </div>
                            <div class="tab-content">
                                <div class="tab-pane active" id="top_events"><p>{% trans "Loading ..." %}</p></div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="page-header clearfix">
                                <h3 class="pull-left">{% trans "New Events" %}</h3>
                                <ul class="nav nav-pills nav-small pull-right">
                                    <li><a href="#new_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-new' organization.slug team.slug %}?minutes=15&amp;limit=5">{% trans "15 minutes" %}</a></li>
                                    <li><a href="#new_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-new' organization.slug team.slug %}?minutes=60&amp;limit=5">{% trans "60 minutes" %}</a></li>
                                    <li class="active"><a href="#new_events" data-toggle="ajtab" data-uri="{% url 'sentry-api-groups-new' organization.slug team.slug %}?minutes=1440&amp;limit=5">{% trans "24 hours" %}</a></li>
                                </ul>
                            </div>
                            <div class="tab-content">
                                <div class="tab-pane active" id="new_events"><p>{% trans "Loading ..." %}</p></div>
                            </div>
                        </div>
                    </div>
                {% else %}
                    {% url 'sentry-create-project' organization.slug as link %}
                    <div class="alert alert-info">{% blocktrans %}You do not have access to any projects. Would you like to <a href="{{ link }}">create a new project</a>?{% endblocktrans %}</div>
                {% endif %}
            </section>
        {% endblock %}
    </div>
{% endblock %}

{% block content_after %}
    <script type="text/javascript">
    $(function(){
        new app.DashboardPage({
            realtime: false,
            stream: false
        });
    })
    </script>
{% endblock %}
