{namespace ot=Opentalent\OtTemplating\ViewHelpers}

<f:if condition="{members -> f:count()} > 0">
    <f:then>
        <f:for each="{members}" as="members" key="category">
            <h3>
                <f:format.case value="{f:translate(key: category)}" mode="upper"/>
            </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>
                                    <f:image class="defer"
                                             data="{'src':'{member.image}/160x0'}"
                                             src="EXT:ot_templating/Resources/Public/media/loading.png"/>
                                </f:then>
                                <f:else if="{member.gender}=='MISTER'">
                                    <f:image class="default"
                                             src="EXT:ot_templating/Resources/Public/media/man-default-2.jpg"/>
                                </f:else>
                                <f:else>
                                    <f:image class="default"
                                             src="EXT:ot_templating/Resources/Public/media/woman-default-2.jpg"/>
                                </f:else>
                            </f:if>
                        </p>
                        <div class="ot-member-name">
                            <div>
                                <f:if condition="{member.fullName}" then="{member.fullName}" else="[Nom masqué]"/>
                            </div>
                        </div>
                    </li>
                </f:for>
            </ul>
        </f:for>

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