{% extends "sentry/bases/modal.html" %}

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

{% block title %}{% trans "Team Settings" %} | {{ block.super }}{% endblock %}

{% block content %}
  <h3>{{ team.name }} <small> {% trans "Team Settings" %}</small>
  </h3>

  <div class="box">
    <div class="box-content with-padding">
      <form class="form-stacked" action="" method="post">
        {% csrf_token %}

        {% if form.errors %}
          <div class="alert alert-block alert-error">{% trans "Please correct the errors below." %}</div>
        {% endif %}

        {{ form|as_crispy_errors }}

        <fieldset>
          {% for field in form %}
            {{ field|as_crispy_field }}
          {% endfor %}
        </fieldset>

        <fieldset class="form-actions">
          <button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>
        </fieldset>
      </form>
    </div>
  </div>

  {% if ACCESS.team_delete %}
  <div class="box">
    <div class="box-header">
      <h3>{% trans "Remove Team" %}</h3>
    </div>
    <div class="box-content with-padding">
      <p>Removing this team will delete associated projects and events.</p>

      <fieldset class="form-actions">
        <a href="{% url 'sentry-remove-team' organization.slug team.slug %}" class="btn btn-danger">{% trans "Remove Team" %}</a>
      </fieldset>
    </div>
  </div>
  {% endif %}
{% endblock %}
