<article id="leaderboards" data-filter="war">
    <header>
        <h3>{{strings.sectionClanLeaderboard}}:</h3>
        <div class="filters">
            <select id="leaderboard-filter">
                <option value="war">{{strings.filterWar}}</option>
                <option value="war-win-rate">{{strings.labelWarWinRate}}</option>
                <option value="donations">{{strings.filterDonations}}</option>
            </select>
        </div>
    </header>

    <div class="leaderboard"  data-filter="war">
        <table class="war-standings" width="100%">
            <thead>
                <th>{{strings.labelRank}}</th>
                <th>{{strings.labelMember}}</th>
                <th>{{strings.labelWarScore}}</th>
            </thead>
            <tbody>
            {% for member in (members|sort(attribute='war_score', reverse=True))[:10] %}
                <tr>
                    <td class="rank rank-{{loop.index}}"><span>{{loop.index}}</span></td>
                    <td class="name"><strong>{{member.name}}</strong></td>
                    <td class="score"><strong>{{member.war_score}}</strong></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="leaderboard"  data-filter="war-win-rate">
        <table class="war-standings" width="100%">
            <thead>
                <th>{{strings.labelRank}}</th>
                <th>{{strings.labelMember}}</th>
                <th>{{strings.labelWarWinRate}}</th>
            </thead>
            <tbody>
            {% for member in (members|rejectattr('war_battles', 'lessthan', config.score.war_win_rate_leaderboard_min_battles)|sort(attribute='war_win_rate', reverse=True))[:10] %}
                <tr>
                    <td class="rank rank-{{loop.index}}"><span>{{loop.index}}</span></td>
                    <td class="name"><strong>{{member.name}}</strong></td>
                    <td class="score"><strong>{{member.war_win_rate}}%</strong></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <p class="disclaimer">* {{ strings.labelWarWinRateDisclaimer|format(config.score.war_win_rate_leaderboard_min_battles, config.history.num_wars_to_track) }}</p>
    </div>

    <div class="leaderboard"  data-filter="donations">
        <table class="war-standings" width="100%" >
            <thead>
                <th>{{strings.labelRank}}</th>
                <th>{{strings.labelMember}}</th>
                <th>{{strings.labelDonations}}</th>
            </thead>
            <tbody>
            {% for member in (members|sort(attribute='donations_daily', reverse=True))[:10] %}
                <tr>
                    <td class="rank rank-{{loop.index}}"><span>{{loop.index}}</span></td>
                    <td class="name"><strong>{{member.name}}</strong></td>
                    <td class="score"><strong>{{member.donations_daily}}</strong> / {{strings.labelDay}}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</article>
