{% extends 'elements/list.html.twig' %}

{% set nb = members|length %}
{% set is_public = not login.isLogged() %}
{% set list_type = 'cards' %}

{% block infoline %}
    {% set infoline = {
        'label': _Tn("%count member", "%count members", nb_members)|replace({'%count': nb_members}),
        'route': {
            'name': 'filterPublicList',
            'args': {
                "type": "trombi"
            }
        }
    } %}
    {{ parent() }}
{% endblock %}

{% block search %}
    <div class="ui icon info visible message">
        <i class="info circle blue icon"></i>
        <div class="content">
            {{ _T("This page shows only members who have choosen to be visible on the public lists and are up-to-date within their contributions. If you want your account to be visible here, edit your profile and check 'Be visible in the members list'") }}
        </div>
    </div>
{% endblock %}

{% block body %}
    {% for member in members %}
        <div class="ui fluid card">
            {% set mid = member.id %}
            <div class="image">
                <img
                    src="{{ url_for("photo", {"id": member.id, "rand": time}) }}"
                    width="{{ member.picture.getOptimalWidth() }}"
                    height="{{ member.picture.getOptimalHeight() }}"
                    alt="{{ member.sfullname }}{% if member.nickname != '' %} ({{ member.nickname|escape }}){% endif %}"
                    />
            </div>
            <div class="content">
                <div class="center aligned header">{{ member.sfullname }}</div>
                {% if member.nickname != '' %}<div class="center aligned meta">{{ member.nickname|escape }}</div>{% endif %}
            </div>
        </div>
    {% else %}
        <div class="ui small message">
            <div class="content">
                <em>{{ _T('No member to show') }}</em>
            </div>
        </div>
    {% endfor %}
{% endblock %}
