{% extends "withnav_template.html" %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}

{% block service_page_title %}
  Invite a team member
{% endblock %}

{% block backLink %}
  {{ usaBackLink({ "href": url_for('main.manage_users', service_id=current_service.id) }) }}
{% endblock %}

{% block maincolumn_content %}

  {{ page_header('Invite {}'.format(user_to_invite.name if user_to_invite else 'a team member')) }}

  {% call form_wrapper() %}

    {% if user_to_invite %}
      <p class="usa-body">
        {{ user_to_invite.email_address }}
      </p>
    {% else %}
      {{ form.email_address(
        param_extensions={
          "classes": ""
        },
        error_message_with_html=True
      ) }}
    {% endif %}

    {% include 'views/manage-users/permissions.html' %}

    {{ page_footer('Send invitation email') }}

  {% endcall %}

{% endblock %}
