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

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

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

{% block wrapperclass %}show-rightbar organization-home{% endblock %}

{% block heading %}<a href="/">Organization Overview</a>{% endblock %}

{% block sidebar %}
  <h6 class="nav-header">Organization</h6>
  <ul class="nav nav-stacked">
    <!-- <li class="nav-header"><h6>{{ organization.name }}</h6></li> -->
    <li>
      <a href="{% absolute_uri '/{}/' organization.slug %}">
        {% trans "Dashboard" %}
      </a>
    </li>
    <li>
      <a href="{% absolute_uri '/organizations/{}/teams/' organization.slug %}">
        {% trans "Projects & Teams" %}
      </a>
    </li>
    {% if ACCESS.org_read %}
    <li class="{% block org_stats_nav %}{% endblock %}">
      <a href="{% url 'sentry-organization-stats' organization.slug %}">
        {% trans "Stats" %}
      </a>
    </li>
    {% endif %}
  </ul>
  <h6 class="nav-header with-divider">{% trans "Issues" %}</h6>
  <ul class="nav nav-stacked">
    <li><a href="{% absolute_uri '/organizations/{}/issues/assigned/' organization.slug %}">{% trans "Assigned to Me" %}</li></a>
    <li><a href="{% absolute_uri '/organizations/{}/issues/bookmarks/' organization.slug %}">{% trans "Bookmarks" %}</li></a>
    <li><a href="{% absolute_uri '/organizations/{}/issues/history/' organization.slug %}">{% trans "History" %}</li></a>
  </ul>
  <h6 class="nav-header with-divider">Manage</h6>
  <ul class="nav nav-stacked">
    {% if ACCESS.org_read %}
    <li class="{% block org_members_nav %}{% endblock %}">
      {% with pending_requests=organization|count_pending_access_requests %}
        <a href="{% url 'sentry-organization-members' organization.slug %}">
          {% trans "Members" %}
          {% if ACCESS.org_write and pending_requests %}
            <span class="badge">{{ pending_requests }}</span>
          {% endif %}
        </a>
      {% endwith %}
    </li>
    {% endif %}
    {% if ACCESS.org_delete %}
      {% feature organizations:sso organization %}
      <li class="{% block org_auth_settings_nav %}{% endblock %}">
        <a href="{% url 'sentry-organization-auth-settings' organization.slug %}">
          {% trans "Auth" %}
        </a>
      </li>
      {% endfeature %}
    {% endif %}
    {% if ACCESS.org_delete %}
      <li class="{% block org_apikeys_nav %}{% endblock %}">
        <a href="{% url 'sentry-organization-api-keys' organization.slug %}">
          {% trans "API Keys" %}
        </a>
      </li>
    {% endif %}
    {% if ACCESS.org_write %}
      <li><a href="{% absolute_uri '/organizations/{}/audit-log/' organization.slug %}">{% trans "Audit Log" %}</a></li>
      <li><a href="{% absolute_uri '/organizations/{}/rate-limits/' organization.slug %}">{% trans "Rate Limits" %}</li></a>
      <li class="{% block org_settings_nav %}{% endblock %}">
        <a href="{% url 'sentry-organization-settings' organization.slug %}">
          {% trans "Settings" %}
        </a>
      </li>
    {% endif %}
  </ul>
  {% block org_sidebar_nav_extra %}
    {% comment %}This block is used by getsentry.com{% endcomment %}
  {% endblock %}
{% endblock %}
