{#
/**
 * Copyright © 2003-2024 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
 */
#}
                <div class="ui basic fitted segment loader_selector">
                    <table class="listing ui celled striped table">
                        <thead>
                            <tr>
                                <th class="left">
                                    {{ _T("Name") }}
                                </th>
                                <th class="left">
                                    {{ _T("Nickname") }}
                                </th>
                                {% if login.isSuperAdmin() %}
                                <th>&nbsp;</th>
                                {% endif %}
                            </tr>
                        </thead>
                        <tbody>
{% for person in persons %}
                            <tr>
                                <td class="username_row">
                                <input type="hidden" name="{{ person_mode }}[]" value="{{ person.id }}"/>
                                {% if person.isCompany() %}
                                    <span>
                                        <i class="ui building outline icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Company") }}</span>
                                    </span>
                                {% elseif person.isMan() %}
                                    <span>
                                        <i class="ui male icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Man") }}</span>
                                    </span>
                                {% elseif person.isWoman() %}
                                    <span>
                                        <i class="ui female icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Woman") }}</span>
                                    </span>
                                {% else %}
                                    <i class="ui icon" aria-hidden="true"></i>
                                {% endif %}
                                {% if person.isAdmin() %}
                                    <span>
                                        <i class="ui user shield red icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Administrator") }}</span>
                                    </span>
                                {% elseif person.isStaff() %}
                                    <span>
                                        <i class="ui user tie orange icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Staff member") }}</span>
                                    </span>
                                {% elseif person.getManagedGroups() %}
                                    <span>
                                        <i class="ui users cog orange icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T('Group manager') }}</span>
                                    </span>
                                {% else %}
                                    <i class="ui icon" aria-hidden="true"></i>
                                {% endif %}
                                <a href="{{ url_for("member", {"id": person.id}) }}">{{ person.sfullname }}</a>
                                </td>
                                <td class="">{{ person.nickname|escape }}</td>
    {% if login.isSuperAdmin() %}
                                <td class="actions_row">
                                    <a
                                            href="{{ url_for("impersonate", {"id": person.id}) }}"
                                    >
                                        <i class="ui user secret grey icon tooltip" aria-hidden="true"></i>
                                        <span class="ui special popup">{{ _T("Log in in as %membername")|replace({"%membername": person.sname}) }}</span>
                                    </a>
                                </td>
                            </tr>
    {% endif %}
{% else %}
                            <tr>
                                <td colspan="{% if login.isSuperAdmin() %}3{% else %}2{% endif %}">
    {% if person_mode == 'members' %}
                                    {{ _T("No member attached") }}
    {% else %}
                                    {{ _T("No manager attached") }}
    {% endif %}
                                </td>
                            </tr>
{% endfor %}
                        </tbody>
                    </table>
                </div>

