{% extends "_base_page.html" %}

{% import "toolkit/forms/macros/forms.html" as forms %}
{% set page_name = 'Invite a new admin user' %}
{% block page_title %}{{ page_name }} – Digital Marketplace admin{% endblock %}
{% block breadcrumb %}
  {%
    with items = [
      {"link": url_for('.index'), "label": "Admin home"},
      {"link": url_for('main.manage_admin_users'), "label": "Manage users"},
      {"label": "Invite a new admin user"}
    ]
  %}
    {% include "toolkit/breadcrumb.html" %}
  {% endwith %}
{% endblock %}


{% block main_content %}

  {% if errors %}
    {% with errors = errors.values() %}
      {% include 'toolkit/forms/validation.html' %}
    {% endwith %}
  {% endif %}

  <div class="grid-row">
    <div class="column-two-thirds">
      {% with
        heading = page_name,
        smaller=True
      %}
      {% include 'toolkit/page-heading.html' %}
      {% endwith %}

      <form method="POST" action="{{ url_for('.invite_admin_user') }}">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
        {%
              with
              name = "email_address",
              question = form.email_address.label.text,
              type = "textbox",
              value = form.email_address.data,
              error = errors.get('email_address', {}).get('message', None)
              %}
          {% include "toolkit/forms/textbox.html" %}
        {% endwith %}
        {%
              with
              name = "role",
              question = form.role.label.text,
              type = "radio",
              options = form.role.toolkit_macro_options,
              value = form.role.data,
              error = errors.get('role', {}).get('message', None)
              %}
          {% include "toolkit/forms/selection-buttons.html" %}
        {% endwith %}
        {% block save_button %}
          {%
            with
            label="Invite user",
            name="submit",
            type="save"
          %}
            {% include "toolkit/button.html" %}
          {% endwith %}
        {% endblock %}
      </form>
    </div>
  </div>
{% endblock %}

Add new template invite_admin_manager to display invite admin form
Add new template invite_admin_manager to display invite admin form
