{% extends "sentry/projects/manage.html" %}

{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_helpers %}

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

{% block inner %}
    <div class="page-header">
        <h2>{% trans "Notifications" %}</h2>
    </div>
    <form action="" method="post" class="form-stacked">
        {% csrf_token %}

        <div class="page-header">
            <h3>{% trans "Events" %}</h3>
        </div>

        {% url 'sentry-project-rules' organization.slug project.slug as link %}
        <p>{% blocktrans %}Sentry will notify you based on the <a href="{{ link }}">rules configured for this project</a>.{% endblocktrans %}</p>

        <div class="page-header">
            <h3>{% trans "General" %}</h3>
        </div>

        {{ general_form|as_crispy_errors }}

        {% for field in general_form %}
            {{ field|as_crispy_field }}
        {% endfor %}

        <div class="page-header">
            <h3>{% trans "Alerts" %}</h3>
        </div>

        <p>{% blocktrans %}Alerts are triggered when the rate of events for the entire project increase by a relative amount. Values represent a 60-second interval.{% endblocktrans %}</p>

        {{ alert_form|as_crispy_errors }}

        {% for field in alert_form %}
            {{ field|as_crispy_field }}
        {% endfor %}

        <fieldset class="form-actions">
            <button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>
        </fieldset>
    </form>
    <script type="text/javascript">
    new app.ProjectNotificationsPage();
    </script>
{% endblock %}

