{% extends "withnav_template.html" %} {% from "components/tick-cross.html" import tick_cross %} {% from "components/live-search.html" import live_search %} {% from "components/button/macro.njk" import govukButton %} {% block service_page_title %} Team members {% endblock %} {% block maincolumn_content %}

Team members

{% if show_search_box %}
{{ live_search(target_selector='.user-list-item', show=True, form=form) }}
{% endif %}
{% for user in users %}

{%- if user.name -%} {{ user.name }}  {%- endif -%} {%- if user.status == 'pending' -%} {{ user.email_address }} (invited) {%- elif user.status == 'cancelled' -%} {{ user.email_address }} (cancelled invite) {%- elif user.id == current_user.id -%} (you) {% else %} {{ user.email_address }} {% endif %}

    {% for permission, label in permissions %} {{ tick_cross( user.has_permission_for_service(current_service.id, permission), label ) }} {% endfor %}
{# only show if the service has folders #} {% if current_service.all_template_folders %}

{% set folder_count = user.template_folders_for_service(current_service) | length %} {% if folder_count == 0 %} Cannot see any folders {% elif folder_count != current_service.all_template_folders | length %} Can see {{ folder_count }} folder{% if folder_count > 1 %}s{% endif %} {% else %} Can see all folders {% endif%}

{% endif %} {% if current_service.has_permission('email_auth') %}

{% if user.auth_type == 'sms_auth' %} Signs in with a text message code {% elif user.auth_type == 'email_auth' %} Signs in with an email link {% elif user.auth_type == 'webauthn_auth' %} Signs in with a security key {% endif %}

{% endif %}
{% if current_user.has_permissions('manage_service') %} {% if user.status == 'pending' %} Cancel invitation for {{ user.email_address }} {% elif user.state == 'active' and current_user.id != user.id %} Change details for {{ user.name }} {{ user.email_address }} {% endif %} {% endif %}
{% endfor %}
{% if current_user.has_permissions('manage_service') %}
{{ govukButton({ "element": "a", "text": "Invite a team member", "href": url_for('.invite_user', service_id=current_service.id), "classes": "govuk-button--secondary" }) }}
{% endif %} {% endblock %}