{% extends "includes/crud/table_list.html" %} {% comment %} NOTE: If you are editing the UI in this template, you likely also want to update the templates for project maintainers and owner lists {% endcomment %} {% load blocktrans trans from i18n %} {% load gravatar_url from gravatar %} {% load org_owner from organizations %} {% load is_admin from privacy_tags %} {% block top_left_menu_items %} {% if filter %}
{% include "includes/filters/form.html" with fields=filter.form %}
{% endif %} {% endblock top_left_menu_items %} {% block create_button %} {# Note: for better performance, avoid multiple admin checks. Call this include with `is_org_admin` #} {% if is_org_admin is not None and is_org_admin or request.user|is_admin:organization %} {% url "organization_team_member_add" organization.slug team.slug as create_url %} {% trans "Invite member" as create_text %} {% include "includes/crud/create_button.html" with url=create_url text=create_text %} {% endif %} {% endblock create_button %} {% block list_placeholder_icon_class %} fad fa-user-plus icon {% endblock list_placeholder_icon_class %} {% block list_placeholder_header_filtered %} {% trans "No matching team members found" %} {% endblock list_placeholder_header_filtered %} {% block list_placeholder_header_empty %} {% trans "Team has no members" %} {% endblock list_placeholder_header_empty %} {% block list_placeholder_text_empty %} {# Note: for better performance, avoid multiple admin checks. Call this include with `is_org_admin` #} {% if is_org_admin is not None and is_org_admin or request.user|is_admin:organization %} {% url "organization_team_member_add" organization.slug team.slug as create_url %} {% trans "Invite member" %} {% endif %} {% endblock list_placeholder_text_empty %} {% block list_item_right_buttons %} {# Note: for better performance, avoid multiple admin checks. Call this include with `is_team_admin` #} {% if is_team_admin is not None and is_team_admin or request.user|org_owner:team %} {% url "organization_team_member_delete" organization.slug team.slug object.pk as form_url %} {% trans "Remove member" as action_text %} {# ``object`` is sometimes a :py:class:`TeamMember` and sometimes a :py:class:`User`, but these attributes match on both #} {% firstof object.get_full_name object.username as user_display %} {% blocktrans trimmed asvar content_text with user=user_display team=team.name %} Remove user {{ user }} from the team {{ team }}? {% endblocktrans %} {% include "includes/crud/remove_button.html" with id=object.pk form_url=form_url action_text=action_text content_text=content_text is_disabled=is_last_user %} {% endif %} {% endblock list_item_right_buttons %} {% block list_item_image %} {# ``object`` is sometimes a :py:class:`TeamMember` and sometimes a :py:class:`User`, but these attributes match on both #} {% firstof object.get_full_name object.username as user_display %} {% blocktrans trimmed with user=user_display %}Profile image for user {{ user }}{% endblocktrans %} {% endblock list_item_image %} {% block list_item_header %} {# ``object`` is sometimes a :py:class:`TeamMember` and sometimes a :py:class:`User`, but these attributes match on both #} {% with full_name=object.get_full_name %} {% if full_name %} {{ full_name }} {% else %} {{ object.username }} {% endif %} {% comment %} This would be a great place to use labels to explain the user's access level. We'd need a property on the User model to get the highest level of access through one of the available teams/organization owners. Use a label element to show the labels, similar to the version listing and other listing views. {% endcomment %} {% if full_name %}
{{ object.username }}
{% endif %} {% endwith %} {% endblock list_item_header %} {% block list_item_meta_items %} {% endblock list_item_meta_items %} {% block list_item_extra %} {% endblock list_item_extra %}