{% if help %}
  {% include 'partials/tour.html' %}
{% else %}
<nav class="navigation">
  <ul>
  {% if current_user.has_permissions('view_activity') %}
    <li><a href="{{ url_for('.service_dashboard', service_id=current_service.id) }}" {{ main_navigation.is_selected('dashboard') }}>Dashboard</a></li>
  {% endif %}
  {% if current_user.has_permissions() %}
    <li><a href="{{ url_for('.choose_template', service_id=current_service.id) }}" {{ main_navigation.is_selected('templates') }}>Templates</a></li>
    {% if not current_user.has_permissions('view_activity') %}
      <li><a href="{{ url_for('.view_notifications', service_id=current_service.id, status='sending,delivered,failed') }}" {{ casework_navigation.is_selected('sent-messages') }}>Sent messages</a></li>
      {% if current_service.has_jobs %}
        <li><a href="{{ url_for('.view_jobs', service_id=current_service.id) }}" {{ casework_navigation.is_selected('uploaded-files') }}>Uploaded files</a></li>
      {% endif %}
    {% endif %}
  {% endif %}
  {% if current_user.has_permissions('send_messages') and current_service.has_permission('letter') and current_service.has_permission('upload_letters') %}
    <li><a href="{{ url_for('main.uploads', service_id=current_service.id) }}" {{ main_navigation.is_selected('uploads') }}>Uploads</a></li>
  {% endif %}
    <li><a href="{{ url_for('.manage_users', service_id=current_service.id) }}" {{ main_navigation.is_selected('team-members') }}>Team members</a></li>
  {% if current_user.has_permissions('manage_service', allow_org_user=True) %}
    <li><a href="{{ url_for('.usage', service_id=current_service.id) }}" {{ main_navigation.is_selected('usage') }}>Usage</a></li>
  {% endif %}
  {% if current_user.has_permissions('manage_api_keys', 'manage_service') %}
    <li><a href="{{ url_for('.service_settings', service_id=current_service.id) }}" {{ main_navigation.is_selected('settings') }}>Settings</a></li>
  {% endif %}
  {% if current_user.has_permissions('manage_api_keys') %}
    <li><a href="{{ url_for('.api_integration', service_id=current_service.id) }}" {{ main_navigation.is_selected('api-integration') }}>API integration</a></li>
  {% endif %}
  </ul>
</nav>
{% endif %}
