{% if help %}
  {% include 'partials/tour.html' %}
{% else %}
<nav class="nav">
  <a class="usa-button margin-top-1 margin-bottom-5 width-full"
    href="{{ url_for('.choose_template', service_id=current_service.id) }}">Send messages</a>
  <ul class="usa-sidenav">
  {% if current_user.has_permissions() %}
    {% if current_user.has_permissions('view_activity') %}
      <li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('dashboard') }}" href="{{ url_for('.service_dashboard', service_id=current_service.id) }}">Dashboard</a></li>
    {% endif %}
      {# <li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('templates') }}" href="{{ url_for('.choose_template', service_id=current_service.id) }}">Send messages</a></li> #}
    {% if not current_user.has_permissions('view_activity') %}
      <li class="usa-sidenav__item"><a class="{{ casework_navigation.is_selected('sent-messages') }}" href="{{ url_for('.view_notifications', service_id=current_service.id, status='sending,delivered,failed') }}">Sent messages</a></li>
    {% endif %}
      <li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_users', service_id=current_service.id) }}">Team members</a></li>
    {% if current_user.has_permissions('manage_service', allow_org_user=True) %}
      <li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('usage') }}" href="{{ url_for('.usage', service_id=current_service.id) }}">Usage</a></li>
    {% endif %}
    {% if current_user.has_permissions('manage_api_keys', 'manage_service') %}
      <li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('settings') }}" href="{{ url_for('.service_settings', service_id=current_service.id) }}">Settings</a></li>
    {% endif %}
    {% if current_user.has_permissions('manage_api_keys') %}
      <!-- <li><a class="usa-link{{ main_navigation.is_selected('api-integration') }}" href="{{ url_for('.api_integration', service_id=current_service.id) }}">API integration</a></li> -->
    {% endif %}
  {% elif current_user.has_permissions(allow_org_user=True) %}
    <li class="usa-sidenav__item"><a class="usa-link{{ main_navigation.is_selected('usage') }}" href="{{ url_for('.usage', service_id=current_service.id) }}">Usage</a></li>
    <li class="usa-sidenav__item"><a class="usa-link{{ main_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_users', service_id=current_service.id) }}">Team members</a></li>
  {% endif %}
  </ul>
</nav>
{% endif %}
