{% extends "base.html" %} {% from '_upsell.html' import crown_badge, max_badge, beta_pill %} {% block title %}{{ _("Team") }}{% endblock %} {% block content %}

{{ _("Team") }}

{# Flash messages #} {% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endwith %} {# Members table #}

group {{ _("Members") }}

{% trans count=members | length %}{{ count }} member{% pluralize %}{{ count }} members{% endtrans %}
{% for m in members %}
{# flex-wrap, not a fixed row: with the role select and the remove button present the controls have nowhere to go on a phone and overlap the email/last-login block. Wrapping drops them to a second line. #}
{# Avatar initials #}
{{ m.email[0].upper() }}
{# Email + meta #}

{{ m.email }} {% if m.is_self %}{{ _("(you)") }}{% endif %}

{% if m.last_login_at %} {% set last_login_date = m.last_login_at|localdt('%b %d, %Y') %} {% trans last_login_date=last_login_date %}Last login {{ last_login_date }}{% endtrans %} {% elif not m.email_verified %} {{ _("Invite pending") }} {% else %} {{ _("Never logged in") }} {% endif %}

{# Role badge #}
{% if m.role == 'admin' %} {{ _("Admin") }} {% elif m.role == 'platform_admin' %} {{ _("Platform Admin") }} {% else %} {{ _("Agent") }} {% endif %}
{# Signature toggle #} {# Actions (hidden for self and platform_admin) #} {% if not m.is_self and m.role != 'platform_admin' %}
{# Change role form #}
{# Remove button #}
{% endif %}
{# Per-user signature editor (collapsed by default) #}
{% endfor %}
{# Invite form — MAX plan required #}

person_add {{ _("Invite a team member") }}

{% if has_feature('team') %}
{% else %}
lock

{{ _("Team collaboration requires the MAX plan") }}

{{ _("Upgrade to MAX for unlimited team members with role-based access.") }}

{% endif %}
{% endblock %}