{namespace ot=Opentalent\OtTemplating\ViewHelpers}

<f:if condition="{members -> f:count()} > 0">
    <f:then>
        <f:for each="{members}" as="members" key="category">
            <h3>
                {category}
            </h3>
            <ul class="ot-members-list">
                <f:for each="{members}" as="member">
                    <li class="ot-member">
                        <p class="ot-member-image">
                            <f:if condition="{member.image}">
                                <f:then>
                                    <img src="{member.image}/160x0" alt=""/>
                                </f:then>
                                <f:else if="{member.gender}=='MISTER'">
                                    <f:image src="EXT:ot_templating/Resources/Public/media/man-default.jpg"/>
                                </f:else>
                                <f:else>
                                    <f:image src="EXT:ot_templating/Resources/Public/media/woman-default.jpg"/>
                                </f:else>
                            </f:if>
                        </p>
                        <p class="ot-member-name">
                            <f:if condition="{member.fullName}" then="{member.fullName}" else="[Nom masqué]"/>
                        </p>
                    </li>
                </f:for>
            </ul>
        </f:for>

    </f:then>
    <f:else>
        <h5><f:translate key="no-members"/></h5>
    </f:else>
</f:if>
